Certainly get the car inspected by a qualified mechanic before you purchase, but you can hopefully rule out a lemon on your own so you don’t have to go through the hassle of taking it to the dealer/shop, having it inspected, only to find that the car has some problems.
I’m no mechanic, but I have a checklist I use when I purchase a car or go look at a car with a friend. I got the steps from somewhere online. Here’s the link: https://onedrive.live.com/redir?resid=7EABBE7D724473FE!236042&authkey=!AFeQVRjzIsNG9J8&ithint=file%2cpdf