When a charged particle, such as a proton or electron, moves it causes a magnetic effect. It is, in fact, the movement of the electrons in the molten iron core that create the Earth's magnetic field.
When a current flows in a wire, it creates a circular magnetic field around the wire.
This magnetic field can deflect the needle of a magnetic compass. The strength of the magnetic field is greater:
It is often useful to be able to remember which way the field points (the direction a compass needle will point) when placed near the wire. The easiest way to do this is called the 'right hand grip rule'.
Hold out your right hand with your thumbs tucked in and your thumb pointing upwards: