Deanasue and I are a bit concerned that the first posts said bettas, plural, but tank, singular. This implies several bettas in one tank. This is do-able with several females or a few males in a divided tank. That's the reason for the questions.
Whenever a tank s being worked on the fish can be temporarily housed in another container of some sort, preferably with the filter and heater running in that other container. In the case of a divided male betta tank, the bettas must be kept in different containers while the work is being done.