Hi,
i thing the h-bridge would be the right option for me as i want to diverse the polarity. [...]
An H-bridge will be a waste of 3 transistors, unless you want to use a permanent magnet as the core. A regular electromagnet with an iron core will
attract magnetizable material no matter its polarity.
what type of h-bridge should i use though?
You shouldn't, but anyway, there is only one
type of H-bridge - the one where 4 transistors and the load is arranged to look like the letter "H" in a schematic.
what precautions should i take when connecting the electromagnet to my controller in order to prevent burning the controller?
Just use a transistor to separate and a fly-back diode directly over the coil terminals to kill the inductive kick from the coil (to keep the transistor alive).