This article is from the Bicycles FAQ, by Mike Iglesias with numerous contributions by others.
Why is road bike specified in the title?
A true trackstand on a track bike is done differently. A track
bike can be pedaled backwards, and doesn't need a hill to
accomplish the rollback affect. Track racing trackstands
are done opposite of what is described. They take place on the
C - D region of the circle, with gravity used for the roll
forward, and back pedaling used for the rollback. This is so
that a racer gets the assist from gravity to get going again
when the competition makes a move.
Why a gear around 42-18?
This is a reasonable middle between too small, where you would
reach the bottom of the stroke on the roll forward, and too big,
where you couldn't generate the roll forward force needed.
Why is the circle counter-clockwise?
Because I assume you are living in an area where travel is done
on the right side of the road. When doing trackstands on the road,
most likely it will be at traffic lights. Roads are crowned - higher
in the middle, lower on the shoulders - and you use this crown as
the uphill portion of the circle (region A-B). If you are in a
country where travel is done on the left side of the road,
please interpret the above aerial views as subterranial.
Why is this done out of the saddle?
It's easier!! It can be done in while seated, but you lose the
freedom to do weight adjustments with your hips.
Why is the left crank forward?
If your right crank was forward, you might bump the front wheel
with your toe. Remember the steering is turned so that the back
of the front wheel is on the right side of the bike. Some bikes
have overlap of the region where the wheel can go and your foot
is. Even if your current bike doesn't have overlap, it's better
to learn the technique as described in case you are demonstrating
your new skill on a bike that does have overlap.
Why the A - B region?
It's the easiest. If you wait till the bike is around 'B', then
you have to keep more force on the pedal to hold it still. If
you are around the 'A' point, there may not be enough slope to
allow the bike to roll back.
What do I do if I want to stop on a downhill?
While there are techniques that can be employed to keep you in
the pedals, for safety sake I would suggest getting out of the
pedals and putting your foot down.
Other exercises that help:
Getting good balance. Work through this progression:
1. Stand on your right foot. Hold this until it feels stable.
2. Close your eyes. Hold this until it feels stable.
3. Go up on your toes. Hold this until it feels stable.
4. If you get to here, never mind, your balance is already wonderful,
else repeat with other foot.