I worked with a guy who is a Mazda devotee. He got all of his family to buy Mazdas. Personally, I had never even known someone to own a Mazda. I wound up buying a used Mazda 6. I researched it thoroughly, and in fact there are many Mazdas that make great used cars.
I used the NHTSA website to look up by VIN number to see if there are any recalls on the car. Many foreign cars have the Takata airbag problem that you can get fixed for free, but be aware that many preowned cars have not had this done yet. Also, you can find somewhat about car owner complaints.
I also used autocheck.com to look up the car by VIN number, and they will give you report about ownership history and recorded problems. This is a pay service, but well worth it in my opinion. It can save you big time.
For general information about what cars make good used cars by make, model and year (including registered complaints) then carcomplaints.com is an excellent resource that will go over most common complaints. Especially important are which cars develop serious problems with their computer, as this manifests itself as sudden revving of the engine and other unpredictable problems. They also rate generaly, but drilling down to the specifics will give you more detail. The year can make a big difference.
I hope this helps.