Humans sweat, dogs pant and laptops generally spin fans to keep cool. Unless you have the tiny, fanless MacBook ($1,269 at Amazon.com), then your MacBook Pro ($1,611 at Amazon Marketplace) or MacBook Air ($859 at Amazon Marketplace) will occasionally fire up its cooling fan to keep its thermals in check. If your Mac's fan has gone from occasionally spinning to regularly and loudly spinning, here's how you can slow its roll (or whir, as it were).
Check apps and tabs
The more apps and browser tabs you've got running, the greater the odds are that your Mac will need to employ its fan to keep things cool. Cut down on your multitasking by closing apps when you are done using them, especially when you are using graphics-intensive apps like Photoshop and iMovie.
To see which apps are using the most CPU resources, open the Activity Monitor and click on the CPU tab. In my experience, Chrome is more of a resource hog than Safari, so you might try switching browsers for a quieter Web browsing experience (and good news, Safari is getting favicons!) I also use my iPhone ($1,000 at Cricket Wireless) to play music and podcasts with iTunes and Spotify instead of keeping those apps running on my MacBook Pro.
Keep vents clear
The MacBook Pro has vents on its sides and back edge, and the MacBook Air has vents along its back edge. These vents draw in cool air and expel hot air. If you block these vents by resting your laptop on a lap, couch cushion, pillow, bed or blanket, then your Mac is sure to heat up quick. I use a coffee table book to keep my MacBook Pro's vents unobstructed when sitting on a couch or lying in bed.
If it looks like a bunch of grime has collected along the vents, you can try blowing it away with a can of compressed air. Of course, you run the risk of just blowing the debris further into your Mac. If that appears to be the case, then you will need to open up your Mac to get under the hood.
Open up and clean
Get yourself a tiny Phillips-head screwdriver and you can remove the bottom panel of your MacBook to clean out any dirt, dust and grime that may have collected over the years. Use your can of compressed air to blow away any debris or a lint-free cloth to wipe it away. Pay particular attention to the cooling fan itself and its vents, along with the entire back edge of your MacBook. The goal here is clean passageways for maximum airflow.
Test your fans
There is a chance that the reason your MacBook is overheating is there's something wrong with the cooling fan itself. Baked into your Mac is a hardware diagnostic tool. If it was made prior to June 2013, you'll use the Apple Hardware Test. After that date, you'll use Apple Diagnostics.
These tools operate in a similar fashion. With your MacBook plugged in and all external peripherals removed, restart it and hold down the D key to start either diagnostic program.
Follow the onscreen instructions to start the test. The standard test takes only a minute or two to complete and will report any hardware issues. For a more thorough investigation, you can check a box to run an extended test that will take an hour or more to complete.
Check out this Apple Support page of reference codes that may appear in the Test Results section after the test completes. There are three codes, all starting with "PPF," related to the cooling fan. If you get one of the results that indicates there may be an issue with your fan, it's time to contact Apple Support or visit your nearest Genius Bar for a repair.
If your Mac is clean and grime-free and you are keeping your apps and tabs in check and the fan is still spinning frequently and loudly, then try resetting the System Management Controller (SMC). The SMC is responsible for controlling low-level functions on your Mac including "thermal management," aka the cooling fan. Follow Apple's instructions for resetting the SMC.
Read more: Everything you need to know about MacOS Mojave.