Hiya!
Er...if you want to write stuff for 5e and plaster "Compatible with 5e Dungeons & Dragons*" [*stuff about non-permission from WotC] right on the cover, go for it! It is 100% LEGAL for anyone to make anything that is compatible or otherwise for use with some other companies product. And, as an added bonus, the rules of 5e are not subject to copyright anyway.
There are some things you can't do...like make your cover 'look and feel' like a WotC D&D product, or have the "Dungeons and Dragons" really big on the cover, or use the "Dungeons & Dragons" graphic text, etc. That all falls under Trademark and Trade Dress. Basically, if a "reasonable person who uses the product(s) would likely be confused as to if WotC is the producer of what they are looking at"... then you have a problem.
That said... there is still nothing stopping WotC/Hasbro from suing you anyway. They don't even have to have even a mediocre chance in h-e-l-l of winning. They just have to file and you have to defend. They have billions, you have....your kids college fund? How long will that last you? A couple days? That is the problem...the legal system (in the USA in particular; "He with the most money, wins").
I am not a lawyer, but I have done a fair amount of reading on the subject. The internet is your friend, as is DuckDuckGo.com or Google or even BING ....just search, read, and decide for yourself.
^_^
Paul L. Ming