Magnets have two poles. Suppose two magnets are brought together. If the poles are different, magnets are attracted. When the polls are the same, magnets are repellent.