What is the problem with my 1997 4.0 ford explorer?

It's making a sound like if a bolt is lose like a metal noise

Rod knock. See a mechanic.

Also it's possible the heat shield on the catalytic converter has broken a weld. Easy to check - Climb under the truck when the engine is *COLD* & thump the cat & see if it rattles. If that's it, get two or three of the longest radiator worm clamps you can get, hook them into one long clamp, wrap it around the middle of the cat, & clamp it down tight.