Give proper written notice to your landlord. If you have a lease, check it to see how much notice is needed. If you don’t have a lease, the landlord must get your notice at least a full month before you move out. In other words, to move out on July 31, you need to give a notice to your landlord in June.
Write to all utility companies that have your name on accounts and tell them to switch your accounts to your new address or to cancel them. Do it in writing and keep a copy so that you have a record of it. If you don’t notify them, you are still responsible for your roommate’s bills.