One thing to do as a preventative measure is to take a pill bottle or some small kitchen container to designate for the extra buttons from new purchases. Often when you buy a garment, there is a little ziploc bag with a button in it. But you need to know where it is years later when that button falls off, so stop and decide where you are going to store all those buttons from now on, so you can find them when needed.
But either the garment didn't come with extras or you can't find the extra button. Going to the sewing store will likely cost you $2 to $5+ dollars for a few buttons possibly like your style of buttons. Not very cheap. And if you buy clothes from the thrift store anyway, may cost more than you paid for the item to begin with.
So, head to the local thrift store that sells clothing cheaply (almost all the ones around here sell their garments for $1). Search in any size clothing for buttons similar to yours. Whether or not it fits, has stains, or is ugly as sin, if you can find a similar button, you have saved money and have others to spare.
Take it home and lop off all the buttons (putting the extras in your button storage) and get to mending! Throw the buttonless clothing item in the rag bag or scrap material pile.
Also, if you are about to throw a pair of pants or button up shirt in the rag pile, steal its buttons before you do so. Buttons come in handy for repairs or crafts.