Autozone does a check engine light test for free which pulls up some codes on their tool then they print out the codes for you in their store.
This will tell you some simple problems that can be going on with your vehicle and let you know what part you might need.
However Autozone doesn't do a complete diagnostics of your car for free or at all.
To get a complete diagnostic done on your cars computer you need to take the vehicle to a professional mechanic shop and have them run their more expensive tools on your vehicle.
The auto shop can see more what's going on with your car than Autozone can.
A good auto shop has good tools that they can use to diagnose your car or trucks problems without having to throw parts at it and hope it works.