The opposite ends or poles of magnets are attracted to each other and like ends repel.
(The opposite; ends; ) (poles of magnets; are attracted; to each other)
The opposite poles of magnets
ends are attracted
to each other