A guitar is a system of moving parts, many of which are mechanical, and as anyone who's ever owned a car can attest, moving things come loose. In guitars, the hardware connections are what typically work themselves loose, such as the nuts on the bridge post or the screws that hold down the pickup covers.
If you hear a rattle, try strumming with one hand to recreate the rattle while touching the various suspects with your other hand. As you touch the offending culprit, the rattle usually stops. Then you can take appropriate measures to tighten up whatever's come loose. (Screws in tuning machines, pickup covers, or jack plates are the most common.) Usually that involves using ordinary tools — screwdrivers, wrenches, chain saws (just kidding) — designed for the appropriate-sized screws, nuts, and so on.
Take an inventory of the sizes and shapes of the screws, nuts, and bolts on your guitar and create a miniature tool kit just for fixing your instrument.