In general, ensure there are no clogs in the hoses, and internal compartments. If there is, the engine will overheat after using it for a few minutes, and shut off. Otherwise, an internal component is faulty. For battery powered vacuums, the battery may be faulty and is inexpensive to replace.
The most common reason why a vacuum will not turn on is that it doesn’t have power. This could be due to a faulty power cord, a bad receptacle, or a tripped breaker. Otherwise, there may be something blocking the airflow that causes the vacuum to shut down automatically.