Turn the second magnet round to change which pole faces the first.

Explore

These two magnets pull together. Turn the second one round so that its N faces the first magnet's N.