Hi and welcome to the forum
In an aquarium with a filter you get colonies of good bacteria that help keep the water clean. It takes about 4-6 weeks for these good bacteria to develop and when they have grown to a suitable number, they will keep ammonia and nitrite at 0.
Ammonia is produced by anything that breaks down in water including fish food, fish waste, dead plants, fish, rotting wood, etc. The ammonia levels build up and harm the fish.
After a couple of weeks you get a colony of good bacteria living in the filter and these eat the ammonia and convert it into nitrite. A few weeks after that and you get more good bacteria that eat the nitrite and convert it into nitrate. When the ammonia and nitrite levels have gone up and come back down to 0, the tank and filter is considered cycled. The good bacteria then keeps any ammonia and nitrite at 0 and the fish can live happily ever after.
If you remove/ replace the filter material (pad, cartridge, sponge, etc) you get rid of the good bacteria and there is nothing to eat the ammonia and convert it into nitrite and nitrate. When this happens the ammonia levels build up and poison the fish.
------------------------
If you don't have an ammonia or nitrite test kit, you can take a glass full of tank water to the local pet shop and ask them to test the water for you. Write the results down (in numbers) when they do the test. If they say the water is fine, ask them what the results are in numbers.
You should also get them to test the pH of the water. If the water has a pH above 7.0, any ammonia becomes extremely toxic and will do more damage to the fish.
You can usually find the pH and GH (general hardness) on your water supply company's website or by telephoning them. These are worth knowing. Alternatively, you can by test kits from the pet shop or online and test the water at home. If you do buy test kits, try to get Ammonia (NH3/ NH4); Nitrite (NO2); Nitrate (NO3) & pH. Try to avoid buying test kits from a warm room or if they are near a heat source or in front of a window. Heat damages the chemicals and can ruin the kits pretty quickly.
If you do get test kits, try to buy liquid test kits because they are generally more accurate than dry paper strips. If you can't afford test kits then just get the pet shop to test it for you.
In the mean time do a 75% water change and gravel clean the substrate each day for a couple of weeks. Leave the fish in the tank when you do this. The water change will not harm the filter bacteria or fish and will help dilute anything in the water that is harming the fish.
Make sure any new water is free of chlorine/ chloramine before it is added to the tank.
If you don't have a gravel cleaner, you can buy a base model like the one in the following link.
https://www.about-goldfish.com/aquarium-cleaning.html
------------------------
When you clean the filter, you should squeeze the filter materials out in a bucket of aquarium water and then put them in the tank. Wash the filter case under tap water until it's clean. Tip any tap water out of the filter case and put the filter materials back in the filter. Fill it with aquarium water and turn it back on.
*NB* Make sure your hands and the filter plug are dry before plugging it in and turning it on.
If you have an external filter like a TopFin or some other filter that sits outside the aquarium, you can put a round sponge on the intake strainer to give it more filtration media. Some internal power filters have a cylindrical sponge with a hole through the center and these sponges usually fit on the intake strainer of external power filters and these help improve filtration.
You can also put small sponges in most filters and these give more filtration area and will last for years, so you don't have to keep replacing filter pads every month. Replacing filter pads is a gimmick from the manufacturers so you keep buying filter pads from them. It does not help the fish or your wallet. Having sponges in a filter will help to hold good bacteria and trap gunk and the sponges can last 10+ years.
If the filter pad/ cartridge has some granules in it, you can cut a small slit in the top of it and pour the granules into the bin. Then squeeze the pad in a bucket of tank water and re-use it. The bucket of dirty tank water can be poured on the garden or lawn.
Power Filters should be cleaned at least once a month and every 2 weeks is better. However, you should not clean the filter for the first 6 weeks otherwise you can wash out the good bacteria before they have established a good foothold. After the 6 week period you can wash the filter media every 2 weeks without any issues.
Summing up, do a 75% water change and gravel clean each day for a couple of weeks.
Get the water tested when you can.
Maybe post a picture or short 20 second video of the fish so we can check it for diseases. But the fish should get better after a few water changes.