Secure the thread and bring the needle to the surface at the position of the button and bring it through the button from the back.
Take the needle down through the other hole and through the fabric, leaving a small gap between the button and the fabric.
Repeat the above to work a few stitches through the button holes. Then take the needle around the threads between the fabric and the button to form a shank.
To finish, work on the wrong side and make a couple of stitches through the threads to secure.