OfficialEasyLevitating a magnet with magnets
The lower magnet is fixed and the upper magnet can move only up and down. Like poles face each other, so they repel, and the upper magnet floats at the height where this balances gravity (the yellow arrow is the force acting on the magnet). Select the upper magnet and set translation and rotation to "Free" in "Mechanics", and it flips over and the magnets attract. This shows that magnets alone cannot levitate stably.