If you are not given any notice by your roommate, you will have some issues. If your roommate leaves the state, you will have no recourse. If your roommate is still local, you could take the matter to the small claims court. You do not need a lawyer for this course and the process is fairly simple. If you go this route, you need to ensure that you have all your documentation ready for your court date and take pictures of any damage caused by your roommate.
If You Want To Stay In The Property
If you want to stay in the property you are renting, you might be tempted to simply get a new roommate without talking to your landlord. This will violate your rental agreement and is grounds for eviction if your landlord finds out. It is better to speak with your landlord as they will generally be amenable to your new roommate. If you do get a new roommate, you will need them to fill out a rental application for everything to be legal.
You do need to be careful with this because your roommate leaving could give a bad landlord an excuse to evict you as well even if you can cover the rental costs. This is due to most rental agreements having a term of stay which will be violated by your original roommate moving out. However, this is generally not a problem as most landlords want their monthly rent without having to go through the process of first finding new tenants with the use of a roommate finder NYC website.