First, you should read your lease carefully to follow the requirements of terminating your lease. Second, pay the rent of your last month in the apartment on time. Make sure there’s no damage in the apartment and make it as clean as possible. Return your key to your landlord on time to avoid any problems. Last but not least, to keep a record of the apartment’s condition, you should always take video or photos of every space of your apartment at the beginning and in the end of your lease. Following the steps above, you should be able to get your deposit back.
The information in this answer is general in nature and is not legal or insurance advice for your specific situation. Policy language varies carrier by carrier; your declarations page is the final word. If you're unsure, call your agent before you need to file.