If you have a quarentine/hospitale tank, you can treat the fish separately in it that is the best option, otherwise its usually best to just treat the whole tank.
Some deseases like whitespot though or other parasite deseases, its generally best to treat the whole tank that infected fish was found in rather than move it to a hospital tank and it treat it separately though.