The sentence that follows correct grammatical conventions is:
"Yesterday Sam forgot to set his alarm, and if he didn’t get my phone call, he would have been late for work."
This version correctly uses commas to separate the clauses in the sentence.