2005 Ford Focus turns off?

While driving I noticed the vehicle slowing down even while pressing the gas pedal and I was not able to turn the steering wheel. Eventually the vehicle turned off. Right afterwards I tried turning the vehicle on and it did but it still keeps turning off out of nowhere. Does this have anything to do with the airflow sensor or what else could it be?

That could be dangerous, have it checked right away.