It is possible that you have some bad gasoline in the tank. Also, your fuel filter or air filter may be clogged.
'''Bad gasoline''': Drain the gasoline out of the tank. Get some new gasoline, and mix in some Seafoam gas treatment (https://seafoamsales.com/small-engines/) - Seafoam is available at most auto parts stores. Now fill your tank with the new gasoline / Seafoam mixture. If the engine will run for just a moment, this will give the new gas / Seafoam a chance to work its way through the fuel system and clean it.
'''Fuel Filter or Air Filter''': If the above doesn't solve it, then remove your air filter, to see if the engine will run. If removing the air filter fixed the problem, then install a new air filter. If that doesn't fix it, then install a new fuel filter.
My lawn mower would run for a minute, then die. I drained the old gas out of the tank, then added new gas / Seafoam. It immediately started running like new, and it has continued to run like new a year later.