First verify that the oven is getting power if it isn't heating properly. See if the oven's various indicator lights turn on as you activate oven functions. If the oven doesn't respond at all, power is likely to blame. Check your breakers to make sure they are all turned on. If the oven is drawing too much power or if another device is plugged into the same circuit, the breaker may have shut off to prevent overload. If the breaker itself is to blame, other lights and devices in your home should usually stop working as well since the oven is rarely on a circuit by itself. Even gas ovens need electricity to ignite the gas for cooking and for other functions.
Electric ovens utilize heating elements inside the main cooking compartments, and the oven won't heat properly if one of these coils burns out. As metal heats, it expands; it contracts again as it cools. The regular expansion and contraction results in the eventual breaking of coils, rendering them unable to function. Inspect the coils inside the oven to look for signs of corrosion, pitting or actual breaks. If this is the reason the oven isn't preheating, the affected elements require replacement.
Some oven models run on timed cycles whereby self-cleaning cycles and cool-downs are automatically regulated by the oven's timer. If the oven is in the middle of one of these cycles, it can't be interrupted unless you adjust the timer to override the cycle. If the timer itself is faulty, the oven may also not function properly because it mistakenly thinks it is in the middle of a cleaning or cooling cycle when it shouldn't be. In that instance, replacing the timer often corrects the problem.
Gas ovens need an igniter to light the gas so the oven can preheat and cook food. The igniter is similar to a heating element in that electricity causes it to heat up; in the process, it expands. As a result, igniters burn out eventually due to age and wear. If your oven's igniter fails, the oven will fill with gas that then doesn't ignite. In such an instance, shut off the oven immediately and ventilate the house to get rid of the gas buildup. Don't use the oven again until the igniter is replaced and the oven is professionally inspected.