The 'check engine" light is a generic "something is wrong" light that is turned on by the car's computer system when it sees anything abnormal in regards XXXXX XXXXX or transmission operation. There are literally hundreds of possible causes for the light to be coming on; ranging from mechanical problems to poor electrical connections, emissions system faults, transmission issues, ignition system problems, etc...
When the light comes on, the computer stores diagnostic information in menory; this includes a fault code to indicate what general area the prroblem is in, as well as a snapshot of the vehicle's data stream coming into the computer at the moment the fault first occurred.
To begin diagnosis of the cause of the problem, the first step is to connect a scan tool to retrieve this information. It is very important to remember that teh fault codes alone never indicate that a specific component has failed, only what system or circuit is behaving abnormally. Then, this information is referenced to a service manual to get the manufacturer's detailed test routine to perfrom for the faults indicated; it is very important to test the vehicle in order to avoid putting parts on unnecessarily. For example, if there is an oxygen sensor code stored that only means that one of the oxygen sensors was reading out of normal range; this could be a failing oxygen sensor but could also be caused by a clogged fuel filter, failing fuel pump, poor electrical connection, leaking vacuum hose, or a poor ground connection. This is why the test sequence is so important; it will systematically test all possible causes to accurately identify the failure.
For this reason, you should take the vehicle in to a repair shop to be accurately diagnosed before buying any more parts. Once the problem is diagnosed, if it is a failed component then you always have the option of taking it back home and bolting on whatever part is needed. Although you will need to pay something for the time and expert advice of teh tech that does the diagnosis, this is almost always far cheaper in the long run than changing a lot of expensive parts and not fixing the problem.
If you decide to take it in for diagnosis, you probably should refrain from unplugging anything or disconnecting the battery. Doing either of these things can store false failure information and/ or erase important clues to the cause of the problem; this complicates diagnosis and resul;ts in additional labor time (and a higher repair bill) because the technician needs to investigate each of the false clues in memory as well as the real ones.