Threads make a habit of unravelling from time to time. When it happens to a sewn-on button, you have to find matching thread and reattach it. As LIFE.hackaday notes, you can stop these threads from fraying with a little bit of nail polish.
Of course, removing the buttons and resewing them is an option, but finding a matching thread colour may be impossible. Instead of that headache, just use a coat of clear nail polish to seal the thread in place and halt the unravelling. Be sure to carefully remove any loose strands before applying the polish.
Just a dab will keep your buttons in place.