I lost a button on the inside of the waistband of a pair of pants. I couldn't use the normal method of sewing on a replacement, because I didn't want anything showing on the other side.
Here's what I used. Besides the usual needle, thread, and scissors, I needed a long-nose pair of locking pliers and a bit of gaffer tape.
Use two layers of the tape to cover one side of the button. This provides a bit of padding for the next step. You could use a different kind of tape, but the gaffer tape is nice because it comes off cleanly without leaving a residue. If you want to use a toothpick to provide some space, put it under the tape so it's held in place.
Pinch the layer you want to sew the button to, pull it away from everything else, and place a pin to keep it folded (also to mark where the button goes). Pull out the old threads.
This is the key step. Align the center of the button with the fold, and use the locking pliers to hold it there. (Here, I should have pulled the button out a bit.)
Thread the needle so you have 12 inches or so, doubled. Tie a knot. Run the needle down through one hole, back out the other, then between the two threads emerging from the knot. Pull tight.
Now push the needle through the fold into one of the hidden button holes and up through an uncovered one.
Repeat several times.
Remove the pliers and finish as usual by taking several turns around the connecting threads, then pushing the needle through.
The button is secure. Note the fabric is puckered because I let the folded fabric overlap a little too much of the button.
Finally, pull off the tape. Add a drop of anti-fray fluid or fingernail polish on the threads to add a bit of protection.