Having some diatoms is good for your tank imo as its a basic food source for a lot of creatures. Having a lot is an eyesore. Typically, the limiting agent in their growth is silicates. So if you're experiencing an explosion of diatoms you are likely introducing silicates in some manner or form. Usually its from your water source... although it can also be from introduction of new live rock with dead sponges on it or some sort of event that kills your tank's sponges.
As for how do you get rid of em... Patience is the only method that really works well. You can throw in silicate removers but they are ineffective ime. Basically, the best method is to starve them out. Prevent them from getting new silicates and eventually the diatoms will die out as your sponges start to grow and absorb your silicates.