Event or state?
English has one passive pattern, be + past participle. Say The door was closed and you cannot tell whether somebody closed it or whether it simply stood shut. Spanish has no way to leave that open: ser + participle is the event, estar + participle is the state it left behind. In both, the participle agrees with the subject, with estar just like an adjective.
A quick test: if you could add by somebody or ask when did it happen?, you want ser. If you could swap the participle for an adjective like shut, ready or empty, you want estar. For a state, La puerta es cerrada is wrong; it is La puerta está cerrada.
Same door, two viewpoints
ser + participle, the event
La puerta fue cerrada por el portero.
The door was closed by the caretaker.
Los documentos fueron firmados por el director.
The documents were signed by the director.
La oficina fue cerrada a las ocho.
The office was closed at eight.
estar + participle, the state
La puerta está cerrada.
The door is closed.
Los documentos están firmados.
The documents are signed.
A las ocho la oficina ya estaba cerrada.
At eight the office was already closed.
ser + por or se?
English reaches for the passive constantly, but in everyday Spanish an event without a named doer is usually expressed with se. That includes the English present passive: The museum is opened is Se inaugura el museo. The ser passive sounds more formal and is mostly used when the doer matters.
El museo fue inaugurado por el rey.
The museum was opened by the king.
Se inauguró el museo el año pasado.
The museum was opened last year.
The passive after modal verbs
After deber, poder and tener que you have both routes: ser + participle, which mirrors English must be done word for word, or se + modal + infinitive. With se, the modal agrees with the thing.
ser + participle or se + verb
ser + participle: more formal
Los contratos deben ser firmados por todos.
The contracts must be signed by everyone.
El coche puede ser reparado en un día.
The car can be repaired in a day.
se + modal: everyday
Se deben firmar los contratos.
The contracts must be signed.
Se puede reparar el coche en un día.
The car can be repaired in a day.