Earnshaw’s theorem from 1842 demonstrates that you can’t get a stable stationary equilibrium with magnets. But there are loopholes! If we lift a magnet with an electromagnet and then reduce the current when it gets to close it can actually float in still air!
A levitating globe can be bought in many versions online, and there are other instructables here that show how to make one yourself.
However, I found that some use very sensitive Hall-switches that result in very little lift, of the order of 1 gram, others use microcontrollers, others components that are hard to come by. Also GreatScott made a great video on the subject, but he had trouble with stability, probably because he put the hall sensor under the levitating object instead of close to the electromagnet. The design presented here is very similar to that from a 2004 MIT paper but uses more commonly available components.
Stop breadboarding and soldering – start making immediately! Adafruit’s Circuit Playground is jam-packed with LEDs, sensors, buttons, alligator clip pads and more. Build projects with Circuit Playground in a few minutes with the drag-and-drop MakeCode programming site, learn computer science using the CS Discoveries class on code.org, jump into CircuitPython to learn Python and hardware together, TinyGO, or even use the Arduino IDE. Circuit Playground Express is the newest and best Circuit Playground board, with support for CircuitPython, MakeCode, and Arduino. It has a powerful processor, 10 NeoPixels, mini speaker, InfraRed receive and transmit, two buttons, a switch, 14 alligator clip pads, and lots of sensors: capacitive touch, IR proximity, temperature, light, motion and sound. A whole wide world of electronics and coding is waiting for you, and it fits in the palm of your hand.