Not specific enough. "dermatitis" just means "inflammation of the skin". In other words, pretty much every rash is a "dermatitis". Without a more specific idea of what is going on, it is impossible to recommend treatment. Even if you are using "dermatitis" as a synonym for "eczema" (as some do), the possibilities are still too broad, since there are so many different kinds of eczema.
Dermat herpetiformis. Most of the time there is no cause found and you can not do anything to prevent it. But sometime it is caused by gluten sensitivity like in celiac disease, then you can be on gluten free diet which may prevent this condition.
No topical steroids. The exact cause of perioral dermatitis is not known. However, it may appear after strong topical steroid creams are applied to the face to treat other conditions. (strong topical steroids should never be applied to the face.) the Fluoride in toothpaste is sometimes blamed, but I think it is rarely (if ever) the cause.