If you want to tighten a bolt, you can purchase a product called thread locker that will secure it. But it may not be necessary to run to the store the next time you need to keep a bolt in place.
Tough as Nails. A common household item can be used to secure the bolt instead. Just brush a bit of nail polish onto the bolt’s threads. Then install the bolt, and thread on the nut.