RULE
will → would, can → could, may → might — these always shift back one step.
must (obligation) usually becomes had to; must (deduction/certainty) can stay must.
going to → was/were going to.
Modals that are already past-like — would, could, should, might — don't change at all.
Commands/instructions are reported with tell/ask + object + to + infinitive, not with 'that'.