Most of us understand that computers need to stay cool, theoretically. But the convenience of a laptop and the reliability of a desktop make it easy to forget to keep this idea in play. The desktop lives in its own special place, wherever that may be, and we go to it when we need to do something. It's easy to forget all the environmental issues that could be going on in there.
First, you want to ensure that there's plenty of airflow around all sides of the computer, especially the back on a desktop and often the bottom and sides for a laptop. While it's easy to declutter your desk or work area, it's also important to remember this tip if your tower lives under your desk, or in a special cubby, because the hot air in those situations can build up and recycle itself, getting hotter and hotter inside the space. Keep the cabinet doors open, for example, or take off the cubby's back panel to ensure proper flow.
You might have heard, or intuited, that taking the case off your computer is a good idea in cases of overheating. That's actually incorrect, because the case around your computer's guts is there to protect it from dirt and fuzz, which is one of the most common causes of overheating. Dust, pet hair, and all the rest of the daily grime are the biggest cause of PC temperature issues, because they interfere with the fans meant to cool your equipment down. If you've ever cracked a case open and looked at the fans inside, you won't have forgotten that grungy sight. Case closed, please.
Which leads us to the most helpful way to be proactive here: by cleaning and/or replacing the fans that keep everything working. While expensive solutions like water-cooling kits and phase-change units (imagine a high-end deep freeze for your machine) aren't necessary for the average computer, you can easily install extra fans for components inside the machine that are getting too excited for their own good. Chances are, whatever fans came pre-installed are not top of the line anyway, so if you're running into repeat issues on this front you might look into extra, or better, fans.
They're easy to spot: There's going to be one on the CPU, one inside the power supply, and probably another one on the front or side of the case itself. Just turn the computer off, take it outside, and clear those fans out with some canned air before deciding whether to upgrade. It's going to be nasty, but it's also pretty satisfying once you've gotten things clean again.