The direction of the curl of magnetic field is determined by right hand thumb rule. Suppose you are holding a current carrying wire in your right hand such that the direction in which your thumb points is the direction of the current in the that wire then the fingers curled will determine the direction of the magnetic field. In B, the direction of current in the wire is towards ourself. Now, use right hand rule such that the thumb points towards yourself. The curled fingers rotate clockwise. Therefore, the magnetic field is in anti-clock direction