I had a fish which was having issues like this, JLK here on AA helped with excellent advice.
Do you have a water test kit? What are your parameters, Ammonia, Nitrites, Nitrates?
Do water changes, 50% then another 50%. Do you have a filter?
If it is the same experience I had, it is a critical situation.
Problems are worsened by poor water quality.
If you have a hang on the back filter, rinse the filter pad in tank water and then clean conditioned water, don't change the pad. Add an additional air pump or at least reduce the water level to increase oxygen for now. But probably will need additional air pump.
I was doing 50-75% water changes every day, mine got better but had two other episodes and it didn't eventually end up well.
I don't really have enough experience to give more help. Your fish may need medication and additional salt in the water to provide treatment.
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