Hello. Sorry to hear your long term fish companion isn't doing well.
Some info about medication below.
What are your water parameters?
Making sure the water quality is in a safe condition would be a good idea. Vac'ing the gravel to get rid of excess muck can be a project maybe 1/3 or 1/4 at a time until it is cleaned across the tank.
Doing this in smaller amounts allows the water difference (new from old water) changes to be gentler to the fish by doing a portion at a time. If it has been awhile since large water changes have been done, it is likely the difference between new water and older tank water is very different. If you had routine 25% every week or more pwc
's then you can do them a bit more quickly. either way you can do a few back to back water changes keeping the tank temperature the same as the pwc
Doing this can get the water freshened up. In addition to removing stuff that causes poor water quality.
Rinsing the filter media with dechlorinated water to get it operating at peak filtration.
If you decide to use medication having the water in the tank in perfect condition is preferred. Fish have a better chance of recovery if they aren't stressed from unsafe water conditions.
New to FW fish? First tank in a long time or EVER??? Need some info on keeping fish?
Start here - Aquarium Advice Article
FW Favorites right now Clown Loaches, any shrimp - SW Vase Red Mangroves