Magnets attract magnetic substances such as iron , nickel, cobalt etc. They can also repel:

Ferromagnetic substances

Diamagnetic substances

None magnetic substances

Paramagnetic substances