Answer:
It is usually done by a special button hole machine.
I doubt if one can do it alone.
The machine basically cuts open a hole, and stitches the surroundings to give it shape.
To hand sew a button hole, use the modified blanket stitch, putting the stitches very close together. An online search for button hole stitch will show you how the stitch is done.