Check engine light came on after buying a used car?

12 days ago I bought a 2001 Honda prelude with only 75,000 miles on it, for 9 grand from a used car dealers. The interior and exterior were mint condition, and, the vehicle was inspected upon purchase by a certified mechanic, and he did not find any issues. After the inspection was complete, I asked the car salesman if the car had any check engine lights on, he told me No. After, I told the car salesman that I wanted to purchase the car today, however, he told me that the earliest I could pick up this car was tomorrow, because he needed to take it to a "shop" to make sure "everything was okay". I think I got scammed, I think he just reset the check engine light that was on and sold the car to me, and deceived me. What kind of legal action can I take? Will I win in court? And if court doesn't help, I will stop making the Monthlty payments on it. But that being said, what will happen if I stop making the payments? What should I do?

"What kind of legal action can I take?" - Any that you wish… Small claims court, call attorneys, etc.

"Will I win in court?" - No. Used vehicles are sold "as is" unless noted to the contrary in writing on the contract. Did you have a warranty? Use it. If not, the fix is out of your pocket.

"If court doesn't help, I'll will stop making payments…" - That would be the dumbest thing to do. The lender wants their money, and it doesn't matter if the car blew up 5 minutes after you signed the contract… You're still on-the-hook for the payments. If you stop making payments, the car will be repoed, and you'll be in a world of you-know-what.

Go back to the dealer tomorrow, and show them the light. They may fix it, they may tell you to go pound sand, but no law forces them to fix your car.