Take your car to an auto parts store. They will hook up to your cars on-board computer system and read the engine code that indicates what the problem is. It's free. I know Autozone will do it for free and I believe several of the other parts stores will too.
Once you know what the code indicates the problem to be, you can take the car to a mechanic. Try not to ever take a car to a mechanic when you don't have any idea what the problem is. They'll stick it to ya!