The physics
Walk once round a closed loop and add B·dl at every step. The total depends only on the current through the loop. This is Ampère's law.
∮B·dl = μ0 Ienc μ0 = 4π × 10⁻⁷ T m/A
Curl the fingers of your right hand the way you walk. A current along your thumb counts plus. For an anticlockwise walk, ⊙ counts plus and ⊗ counts minus.
Pick a loop where B has one size along it. Then ∮B·dl is B times the loop's length.
long wire: B = μ0 I / 2πr inside a thick wire: B = μ0 I r / 2πa²
toroid: B = μ0 N I / 2πr long solenoid: B = μ0 n I
An open path near a long wire sweeps a share of a full turn. It gets the same share of μ0 I.