Before you wear a new garment, put a little clear nail polish on the front and back threads of each button. Buttons will stay on longer when their threads are sealed.
When I'm sewing buttons on young children's clothes or homemade toys, I use dental floss instead of thread. The floss that is "tape" is nearly impossible to break. I've used it often thru the years and no child has ever gotten a button off.