First and most importantly the pilots have to get their own oxygen masks on, if they delay this at all they will become hypoxic, unable to think clearly, then pass out, and then it's over for all on board.
Agreed, this is definitely the first order of business. Similarly for passengers, always put your own mask on first before helping anyone else near you. Can't help if you pass out.