Step 1: What a magnetic dipole is.
Isolated magnetic poles are never found, so the simplest magnetic object is a dipole: two equal and opposite poles $+q_m$ and $-q_m$ a short distance $2l$ apart, like a small bar magnet. Its dipole moment is the product of pole strength and separation, $m = q_m(2l)$, directed from the south pole to the north pole. A current loop of area $A$ carrying current $I$ behaves the same way, with $m = IA$.
Step 2: Place the dipole in a uniform field.
Let the dipole make an angle $\theta$ with a uniform field $\vec{B}$, and let the line joining the poles be the axis of the dipole. The force on a pole is the pole strength times the field.
Force on the north pole: $q_m B$ along $\vec{B}$.
Force on the south pole: $q_m B$ opposite to $\vec{B}$.
Step 3: Net force and torque.
The two forces are equal and opposite, so the net force is zero and the centre does not accelerate. They act at different points, so they form a couple. The perpendicular distance between their lines of action is $2l\sin\theta$.
\[ \tau = q_m B \times 2l\sin\theta = (q_m \cdot 2l)\,B\sin\theta \]
Step 4: Put in the dipole moment.
Since $m = q_m \cdot 2l$, we get $\tau = mB\sin\theta$. In vector form the torque is perpendicular to both $\vec{m}$ and $\vec{B}$, so $\vec{\tau} = \vec{m} \times \vec{B}$.
Step 5: Cross-check with energy.
Work done in turning the dipole from $\theta_1$ to $\theta_2$ is $\int mB\sin\theta\, d\theta = mB(\cos\theta_1 - \cos\theta_2)$. This gives the potential energy $U = -mB\cos\theta$, and $-dU/d\theta = -mB\sin\theta$ has the same size as the torque, so the two descriptions agree. The same result holds for a current loop since its moment is $m = IA$.
Final Answer:
A magnetic dipole is a pair of equal and opposite poles a small distance apart. In a uniform field the torque on it has magnitude
\[ \boxed{\tau = mB\sin\theta} \]