Termination of the rental contract
In the rental contract the landlord will have described how you can cancel your rent agreement. Sometimes you can cancel via the website of the landlord and sometimes you have to send a letter. If you want to be sure that your cancellation will be processed, please send a registered letter. Then the letter will be delivered personally to your landlord and you will receive proof that it has been delivered to the right address.
There are a number of rules that apply if you want to cancel your rent agreement. Think of the notice period (usually at least 1 month) and the condition you must leave the rented property in. This is often described in your rental contract.
If you have a temporary rental contract, the rental contract term runs up to the date stated in your contract. You are not obliged to rent until that date, you can always cancel the lease earlier.
If your situation is intermediate letting or subletting, you temporarily take over a home from the current tenant. For example, because the person has an internship abroad. If the original tenant returns, the house will be theirs again and you will need to leave. You make an agreement with each other for a specific period. This period cannot be cancelled earlier.