I battled diatoms for about 6 months. Most people usually only have to battle it for a month or so, but I think mine was extended due to "I didn't know what I was doing" and "I was using black sand"
Couple of tips to help you that I found useful. First, diatoms are usually caused by excess silicia in the water. Silicia usually comes from your rocks or water. If it's from your rocks, it will just take time for them to finish seeping into the water and will eventually go away. If it's from the water, then you should start using RO/DI water, otherwise it will never go away. If you use your own RO/DI water, I found that SilicaBuster can help for really troublesome water.
The next thing that helps is increasing the flow in your tank and having snails that like to move the sand around. For instance, nassarius snails.
Next, I found putting filters over the powerheads tends to trap alot of the diatoms in the tanks. Put filters on and clean them every 2-3 days. For instance, something like this:
https://www.bulkreefsupply.com/vortech-mp20-mp40w-foam-guards-3-pack.html You can make your own if you want. Try once a day blowing the diatoms off the rocks too to get them into the water and into the filters.
This can help them go away much faster than on their own.