One of the characteristic properties of a magnet is its magnetic field lines.
The properties of magnetic field lines are:
The lines seem to move out of the magnet from the north pole.
The lines seem to move into the magnet from the south pole.
These magnetic field lines never intersect each other.
The tangent at each point gives the direction of the magnetic field at that point.
Inside the magnet, the lines travel from the south pole to the north pole.
Outside the magnet, the lines travel from the north pole to the south pole.
Hence, when a south pole is placed in close proximity to a north pole of another magnet, the magnetic field lines coming out of the north pole tend to go towards the south pole of the other magnet.