Here is the solution that worked for me, and it is both easy and free!
I have a 2001 Toyota Echo with 110k miles on it that has needed only very minor repairs over the years (new tires, etc), most of which my husband has done. The check engine light came on about 2 years ago after I left the lights on and had to jump-start the car (no idea if those two things were related). My husband replaced the mass air flow sensor, and the light came back on. I ignored it for a while, since there didn't appear to be anything actually wrong with the car, and it ran fine.
Then I had to take it in for emissions testing, and they automatically fail you if the check engine light is on. They said it looked like the O2 sensor needed to be replaced, so my husband replaced it. The check engine light came back on. At this point I was at a couple hundred dollars in parts, but nothing too expensive...but I still needed to pass emissions. So my husband read online that if you disconnect the battery, press down the brake pedal for about 10 seconds, and then reconnect the battery, it resets the warning lights. I did this and drove straight to the emissions testing place earlier this morning. They passed me, so I have to assume there is nothing actually wrong with the car. The light will come back on eventually, but it just has to stay off long enough to pass. Problem solved until I have to disconnect the battery again and reset the warning lights in another 2 years for emissions testing.
ETA: I do own one of those things that gives you the diagnostic codes that someone else recommended upthread.