A moving charged particle creates a magnetic field around it. Charge through a wire creates a magnetic field around it, the properties of which can be determined using a right hand rule.
All magnetic fields are created by moving charged particles. Stationary charged particles do not generate magnetic fields. An electromagnet is a magnet that relies on an electric current to produce the magnetic field.
i hope this really helps..