Glad to see that you have received answers and it is all covered.
I agree with Toogie. You need to wrap the needle thread around the thread you stitched between fabric and button. But to be able to make it loose enough to do this you need to LOOSELY sew on the button, otherwise, it will still be too taut to make the button stand away from the pants. A wooden matchstick works well to put between fabric and button.
You can use a thin crochet hook or something similar to stand the button away from the fabric. Main thing is to strengthen the thread under the button by going into the loop making like a chain stitch.
Are you sewing by hand or machine?
If hand sewing, after you have stitched the button on and before you tie off, wrap the thread around the stitching, underneath the button. Wrap it between the button and the shirt. It makes the button stand up more, away from the shirt, giving you extra room to fasten.
I have not tried on the machine, but I think if you placed anything small that would fit between the holes of the button and the shirt itself, it would give you enough 'lift'. I was thinking like using the shaft of the ripper, but just make sure it stays between the holes of the button and your needle doesn't hit. Sew slowly...!!! Look around you should be able to find something to place under button and between holes. Let me know what you come up with. Curious minds want to know-lol
Some brands have a special foot but that's an expensive way to do it. Placing a washer under the button works as well.
I learned at a very young age to put a matchstick underneath a button and before long I could keep some room underneath and still do it that way. Don't use a sewing machine unless it's more than just a couple that need to be sewn on.
Thanks!
I have used my machine to stitch buttons on in the past, but I'd have to do this by hand.