I have a 09 Mazda 6 that I purchased used about 3 years ago. For the past couple of months or so it has been making a soft, metallic rattling whenever I accelerated at low speeds (usually when I accelerated even a little bit at about 20MPH). For the past two days the sound has gotten much louder. When I googled the issue the two most common causes seemed to be engine knock or a loose heat shield. The noise sounds like its coming from below the floor of the car, not the engine. How do I check if the heat shield is loose? And if it is loose, what do I need to do to fix it? Or should I just take it off?
To check the heat shield, you'll have to raise the car up so that you can get underneath it and locate the exhaust system. Here is a picture of a corroded heat shield.
You should be able to move the heat shield with your hand if it's loose (do this while the car is cool, mind you). If you want an easy fix, I usually just self-tap a short screw into the loose heat shield area so that it sits snugly against the exhaust again. It's not recommended that you remove a heat shield completely without replacing it as it is actually a very useful component. The exhaust system gets extremely hot so keeping that heat contained and away from vital areas on the car is very important.
Get the car up so you can safely get under it. Either jack it up and rest it on jack stands, or drive it up on wheel ramps, or park one side of the car on a curb.
The last 2 options require starting the engine, so let the car sit for quite a while before getting underneath it. The engine may be cold, but exhaust gets hot faster than most people think. Once under there, poke around the heat shields, see which ones are loose. For most cars, the heat shield is in several sections (from front to back), and there are 2 "layers" of heat shields: one above the exhaust pipe to keep the heat away from the car, one below the exhaust pipe to prevent you from starting grass fires when you park off the road.
The upper layer is absolutely required, if it's loose tighten it either with screws as recommend in the other answer, or find how it got loose in the first place (broken or loose fastener, or rusted away from the fastener) and address that. The lower layer, it's your call. I don't ever park on grass, so when mine came loose, they got removed.