Whether or not you can just cancel your rental agreement depends on the agreements you have made.
Rights of termination agreed upon: Depending on the agreement, you have the right to terminate within the stated period.
No rights of termination has been agreed upon: this may be the case for short rental periods. It depends on the courtesy of your landlord. Theoretically, your landlord has the right to demand the full rent. A cancellation fee is usually agreed upon. If you can not reach an agreement with your landlord, please contact firstname.lastname@example.org or +49 221 988 611 88 and we will try to find a solution.