That means lots of practice, but:
Concentrating on an achievable goal.
Stopping for a rest or a change when it starts to go wrong - otherwise you will just reinforce the muscle memory for how to do it wrong!
The ideal learning area has a wall or fence at one side, a 10 metres of smooth concrete or tarmac. Riding on uneven ground is much more difficult.
Put the pedal at the bottom, but your foot on it, put the seat in place, put your hand on the wall, and step up. It is the weight of your foot on the bottom pedal that keeps the uni steady.
If the pedal is anywhere else except the bottom, you will risk falling and hurting yourself.
Once you are on, try to move the uni until the cranks are more or less horizontal, but with your “strong foot” slightly higher.
Now relax. Get used to sitting up there.
Now, aim the uni away from the wall a bit (not at right angles, but say 30 degrees or so).
Let the uni start to fall in the direction you want to go, and pedal smoothly.
Count the pedal strokes. There will be exactly one of them before you fall of.
If you fall off the back, you will hurt yourself, and it is a sure sign that you are not committing yourself. You should always fall off the front.
Keep repeating this exercise until you suddenly do 2 pedal strokes, then 3.
Keep a count of your “best score”.
A chart of your progress will look something like this:
Once you get past about 20, the rest is just practice and experience.
Keep your weight on the saddle, not on the pedals.
Look where you are planning to go; don’t look down.
This is a great sport.