Electromagnets are used for various purposes but I fathom in this instance, the questioner is asking about how electromagnetics can be used to attraction or repulsion. Example, electromagnets are used for attraction in cranes which attach them to containers in order to lift them. Meanwhile, Maglev trains use electromagnets repulsive properties.