Good day.
First of all, it is necessary to call the police and report this fact.
In the future, depending on the specific situation, you need to apply to the court with the requirement to remove the obstacle to the use of the apartment by moving in.