I will not attempt to answer your specific question, instead suggest a technique for constructing quality sentences.
I presume the sentence you are asking about comes with a context and a lot of words in your draft have already been used in the preceding sentences.
As your first cut for the next idea you want to explain, try writing down just words you will need for this idea - but which you have not yet used. In this case, you might get something like this:
proper handstand learn against a wall.
Now try filling out those words until you get a grammatically complete sentence. You might then get to this:
To do a proper handstand, learn how to do it leaning against a wall.
In my opinion, that sounds much better than either of your examples because it focuses on the new concept you are attempting to explain.