If Apple went bankrupt, Everyone would be without a job.

Not it they simply went Chapter 11 and reorganized.

Is that how filing for bankruptcy works?

That's how chapter 11 type bankruptcy works. The business continues to run but the debtors are now the owners. There's also chapter 7 where the business shuts down and stripped for parts to pay the debts.

Yeah, Trump went bankrupt 3 times, and he's still here

Companies in USA go bankrupt all the time and keep operating.

It's just a legal way to not pay your debts as I understand.

Anyway it happened to me. Basically any stock they gave us was worthless but they kept going and paid salaries.