In general, the procedure will be to exercise good pilot judgement. In many cases, this will include or begin with pulling out the checklist and/or performing memory items from the checklist.
Small airplanes don't have the huge array of sensors that airliners are equipped with. Especially in an ultralight like the C42, you might be lucky to have a few engine instruments and a master caution/warning light.
For example, in the C42 that I fly, the typical reason for the master problem (really, a combined master caution and master warning) light to come on in flight is that the cylinder head temperature is too high, in which case in that airplane the appropriate action is to fully open the cowl flap and to reduce power but generally to maintain speed, to allow the engine to cool down in a quick but controlled manner allowing continued flight; then adjust the cowl flap for the current flight regime. The way to verify that this is actually the problem is to look over at the CHT gauge and see if it's above the green arc. However, if it's not the CHT, that same light might come on for, say, an electrical problem, which would call for an entirely different set of actions in response and might require landing soon, before the battery is depleted.
The lights only really serve to direct the pilot's attention to the fact that there is a problem.
I agree with Sanchises' point to never ignore warning lights, or for that matter other indications of problems, in an aircraft. Heck, I don't ignore warning lights even in my car, let alone in an airplane. (I don't know how many times I've told my instructor something along the lines of "it wants attention" as I started to scan the instruments specifically to see what problem caused the problem light to come on.) That doesn't mean that the appropriate response for every problem is to land immediately.
On the flip side, in extreme situations, it might be appropriate to continue flying even with something like a low oil pressure indication, which if determined to be accurate (which you can't always rely on, and certainly can't assume; it's the old adage, trust but verify) would normally call for an engine shutdown and engine-off landing. To keep flying with low oil pressure will quite possibly ruin the engine, but if the alternative is a crash landing or a ditching over open water, then it comes down to that rebuilding or replacing the engine is likely to be cheaper than would be replacing the entire airplane. Either way, though, in such a situation you make an informed, conscious decision on which action to take in response to the problem. Following the prepared checklist for diagnosing and dealing with the problem in that particular airplane should be the first step in that process.
Expect great fun when you're just entering the downwind leg for landing, or are at low altitude and near the end of the runway during climb-out, or over the woods, or some similarly precarious situation, and the instructor tells you "we have an engine fire, now what do you do?".