Cleaning gravel can be tricky, so histhis is actually a good question.
In short- you can leave the fish in the tank- just watch what you put in.
But as far as way to clean gravel goes, here are some of my answers:
This best approach is, as mentioned before, to look at your tank as an ecosystem. In the natural environment there would be loads of
other decomposers and bugs to take care of the gunk piling up. Snails and bottom feeders are great for this.Stirring up the gravel could help your filter do the work.
You could then also ultimately remove the gravel from the tank and clean it, but take caution: Any chemical can obviously be harmful to your animals. Clean the gravel in fresh water with as little chemicals as you can (I've heard of people who took out gravel, bleached their gravel and then put it back and killed off all their fish). I really recommend just doing this mechanically, scrubbing them in a cloth can work. Then leave to dry out in the sun (The sun will also help bleach the stones and kills algae). Then rinse off in fresh water again. Then, like with new water, introduce the clean gravel little bit by little bit. It's a pain and there are probably better ways, but it's safe.
Hope this helps!