I have always admired the way some yoga teachers do a headstand or a handstand. They don't push off the floor with their feet. No. They do it smoothly and gracefully. As if their body is absolutely independent of gravity and other terrestrial laws. It obeys only its master. They rest on their hands and slowly pull their legs up to themselves first, and then beautifully and easily lift their straightened legs up. Of course, the ability to keep a balance is in the first place here, but believe me, lifting your straight legs with just a press is not an easy task. To do this, you need to train for a very long time.
If you are a beginner, do the exercise by pulling your knees up to your chest. If this is too easy for you, complicate the task and pull up straight legs to the body, smoothly moving from the bar to the "dog head down" pose or, as it is also called, "slide".
By the way, at the initial level, they first teach you to lift straight legs in a headstand, and then they move on to a handstand.