This term can refer to the overall effect throughout the universe of magnetism reacting with electricity, but in a localized sense it can refer to an area of exceptional electromagnetism or a magnetic field created artificially using coils, through which an electric current is passed, to create magnetism. The direction of this field depends on the direction of the current sent through the coil. The strength and radius of the field is limited to a local area around the object. The higher the current is which passes through the coil, the stronger the field and it effects will be with respect to the distance of the object.
Federation starships, including USS Enterprise-D, USS Voyager, and runabouts use magnetic interlocks to constrain the antimatter flow. (Star Trek Generations; VOY: "Emanations"; DS9: "Our Man Bashir")
The Borg used an electromagnetic field to prevent transporter access to their cube after the battle of Wolf 359. This tactic was circumvented by piloting a shuttle through the field and transporting from inside the field. (TNG: "The Best of Both Worlds, Part II")
In 2369, Lieutenant Jadzia Dax created an electromagnetic pulse which was sent via Deep Space 9's tractor beam to the Federation freighter Norkova. This pulse was reflected by the freighters shields and created an electromagnetic field which freed Doctor Julian Bashir from the consciousness of the Kobliad criminal Rao Vantika. (DS9: "The Passenger")