While this is considered an absolute rule by many artists, especially painters, I consider it more a helpful hint and something to try.
The idea is to use a limited palette of colors to create a unified look. Pick three colors that represent the majority of items in your work, plus black and white, and only use those three colors (and the colors that can be mixed from them) to do the whole piece.
It’s easier than it sounds. For example, a forest painting might be done entirely with a yellow, a deep green, and an umber. Or a seascape might be a deep blue, a deep green, and a purple. In watercolors, usually this means picking three tubes of pigment and just using those. This really does help avoid the problem of the painting looking too busy or garish. I’m sure we’ve all seen a painting that just uses two many colors!
I’ve been told by an old watercolor painter that this is an absolute rule except in the case of city scenes, but I am not willing to be quite that rigid about it. Still, choosing two to three colors and using them and their mixtures can make a really nice, unified looking piece.