Do you have a rental contract for main residence? Then you or the landlord should send a notice letter to end the rental contract.
What if you haven't found a new home by the end of the notice period?
Then ask the landlord if you can stay until a later date. You let the landlord know why you cannot possibly move. Send this in a registered letter at least one month before the end of the notice period. You can only stay in your home until a later date with the landlord's written agreement.
If your landlord doesn't grant an extension, you can file a lawsuit with the justice of peace. The justice of peace will extend your rental contract only if there are extraordinary circumstances.
examples:
You are serioulsy ill
You had an accident
You are very old
You are pregnant and need to rest
...
If the justice of peace finds that there are extraordinary circumstances, then the justice of peace will extend your rental contract to a specific date.