When your car fails to start but the starter motor is cranking, one of the common culprit is your battery which forms part of the ignition system. Consider checking first whether your battery is dead or weak. One way to find out whether the battery is what's causing the starting failure is by removing your battery and then using other car's battery and if it still does not work then it may be safe to say that the battery is not the one causing the failure. Try also checking the alternator and starter motor.
After ruling out the battery, another probable cause may be the fuel. But first make sure that your car has a fuel on it. Do not rely on the fuel gauge on the dashboard because it may have malfunctioned and could have misled you like what happened to my car wherein the fuel indicator says that the fuel tank still has some fuel in it but after removing the air filter and checking the carburetor, it was very dry which means that there was no fuel reaching it. The fuel filter may have been dirty and could have been blocking the fuel from properly passing through, but to make sure I tried filling the fuel tank with a liter of fuel and then tried starting the car and then the car started fine. Thus, it is always better to make sure first that the fuel tank is not empty before calling a mechanic as the fuel indicator may have just malfunctioned. Other things which may be inspected and tested are the spark plugs.