Aw I'm sorry to hear :(
First of all, you'll want to clean the tank. Do a 75-80% change on the water (if there's still living things in the tank like algae eaters/inverts/live plants. Clean the filter. Set up the tank and start running it ASAP. Wait a few weeks for it to completely cycle before getting a new fish.
When you get a new fish, slowly acclimate it to the new tank. Float it in the cup it comes in and over the course of an hour slowly drip-acclimate it. This will help him slowly get used to the new water rather than the typical method of floating them until the temp is the same.