* By fixing the problem: This is the proper way. The light comes on because the onboard diagnostic system (OBD-II) has detected a fault. Fixing the underlying issue will usually cause the light to turn off automatically after a few driving cycles (the car's computer monitors the system to ensure the problem is resolved).
* By using an OBD-II scanner to clear the code: A mechanic or someone with a scanner can clear the trouble code(s) stored in the car's computer. However, this only turns off the light; it doesn't fix the problem. If the issue persists, the light will likely come back on.
In short: You can turn off the light, but you *shouldn't* unless you've addressed the reason it's on. Ignoring the problem could lead to further damage or even safety hazards. It's best to get the code read by a mechanic to diagnose the underlying issue and have it repaired.