"Une porte se ferme, une autre s'ouvre."
This is a direct translation of the English proverb and captures its meaning perfectly.
Here are some other ways to express the same idea in French:
* "Quand une porte se ferme, une autre s'ouvre." (When a door closes, another opens)
* "Chaque fin est un nouveau début." (Every end is a new beginning)
* "Il y a toujours une lumière au bout du tunnel." (There is always a light at the end of the tunnel)
The best option for you will depend on the specific context and your desired level of formality.