On the connector - there should be 2 main components at each end -
The connector body soldered in to the board, with the contacts showing, coming vertically from the board.
A movable, hinged, plastic 'keeper' that when pushed into place in its slot compresses the flex cable against the contacts and holds it in place.
So the reconnect would be as follows, assuming the keeper is still in place -
Move the keeper away from the contacts.
Insert the flex cable into the connector with the contact fingers adjacent to the contacts in the connector.
Ensuring the flex is fully home (you ideally need 3 hands for this ...) twist up the keeper and push it down into its slot.
This will hold the flex contacts sprung against the connector contacts.
After this, the flex should be securely in place, and should not come out when gently pulled.
If the plastic keeper has the hinge tabs at the ends broken, that won't affect it's operation, it just makes it a bit harder to hold in place when inserting the flex.
If the plastic keeper is missing - cut a thin piece of plastic to size and use it instead.
It can be longer than the original, along the flex length, for ease of insertion.
I've used the thin plastic from a milk bottle for this purpose, but any slightly flexible plastic will do.
Hope that helps.