i had a bit of ammonia and now i have nitrites and nitrates
whats the best way to get rid of them
Yes and don't underestimate that concern. Even if the nitrites don't kill your fish outright they may damage them internally. This will make your fish more open to other illnesses and disease.so my only concern should b the nitrites
To help your fish deal with the ammonia and nitrite do daily partial water changes of 30% using a good quality declorinator. (Amquel+ and Prime will remove ammonia and detoxify nitrite).
To detoxify the nitrite add aquarium salt at the rate of 1 TEAspoon per ten gallons. Increase tank areation. Feed sparingly until the water parameters are where they should be.