Modal second, gemacht werden last
A modal verb with a passive combines two structures you know. The modal stands in position two and agrees with the subject. The rest goes to the end: first the Partizip II, then werden in the infinitive, because a modal always takes an infinitive.
From active to passive
Wir müssen das heute machen.
We have to do that today.
Das muss heute gemacht werden.
That has to be done today.
Building the sentence
Start from an active sentence. The Akkusativ object becomes the Nominativ subject, and the modal now agrees with it. The infinitive of the main verb turns into Partizip II + werden. Most modal passives come from a man sentence, which disappears.
The conversion
Four modals in the passive
Der Ausweis muss am Eingang vorgelegt werden.
ID must be shown at the entrance.
Die Formulare können im Büro abgeholt werden.
The forms can be collected at the office.
The modal agrees with the plural subject.
Hier darf nicht geparkt werden.
Parking is not allowed here.
Die Sitzung soll verschoben werden.
The meeting is supposed to be postponed.
In a subordinate clause
After weil, dass or ob, the conjugated verb goes to the very end. So the modal comes last, after werden: a chunk of three words in a fixed order.
Der Antrag muss heute abgeschickt werden.
The application has to be sent off today.
main clause
Ich weiß, dass der Antrag heute abgeschickt werden muss.
I know the application has to be sent off today.
subordinate clause
Wir warten noch, weil das Auto erst repariert werden muss.
We're still waiting because the car has to be repaired first.
In the past
For the past, put the modal into the Präteritum and leave the end of the sentence as it is. This is the usual form in speech and in writing.
Der Termin musste leider abgesagt werden.
The appointment unfortunately had to be cancelled.
Die Tür konnte nicht geöffnet werden.
The door could not be opened.