I thought that right hand rule was for find the magnetic field generated by a current, where your thumb point in direction of the current. However, I was watching something that said we can curl our fingers in the direction of the proton's spin, and that will give us the field direction. Where does that right hand rule come from?
When current flows in a circle, we can use the right hand rule to find that the magnetic field points in one direction inside the loop, and in the other direction outside the loop (to be precise, the magnetic field lines wrap around the wire, as shown in the second diagram below). Thus, in the case of current carrying loops, if we curl the fingers of our right hand in the direction of the current flow, our right thumb will point in the direction of the loop's magnetic dipole moment, which is also the direction of the magnetic field at the center of the loop. The two pictures below show a current carrying loop in a top-down view and a side cross-sectional view. Hope they help. Thus, this other right hand rule is derived from the first one, it's just a quick short cut we can use for current carrying loops (or spinning charges).