It is important to clean the threads carefully. A wire brush works well. It may help, on the metal threads, to use a solvent of some kind. WD-40, brake cleaner, nail polish remover, whatever.
I use Rectorseal #9 slow set, which is a paste compound available in most hardware stores and home centers. I apply a moderate coat to male threads and a light coat to the start of the female threads.
Sometimes, for difficult joints that are prone to leakage, it is helpful to apply a light coat of Rectorseal #9, then wrap the joint with teflon tape, then apply another light coat of Rectorseal #9. It's easy to crossthread the joint at this point so be very careful when starting the threads.
There are a number of alternatives if that doesn't work. For one, you can replace the threaded flange on the valve for around $5, which may help if the plastic threads are in poor condition.
Another step to try is to use a 3" pipe tap to chase the threads on the black tank. They are prohibitively expensive to purchase but rental places sometimes have them or you can pay a plumber who has one to do it for you.
Or you can try making an ersatz tap out of a 3" diameter steel nipple by grinding some slots in the threads to allow scraping action to occur.
Failing that you can try a 3" close steel nipple, which may seal to the old threads better than the plastic, and then replace the male 3" flange on the valve with a female 3" flange, which is readily available from Valterra.
To learn to see below the surface, you must adjust your altitude