Find them in other public domain works.
Gary Gygax faced the same problem when TSR was threatened with a lawsuit over creatures appearing in the works of Tolkien. His solution was to prove that these creatures appeared in much older, out-of-copyright works, including ancient mythology and medieval bestiaries.
Gygax was successful at convincing the company to drop the lawsuit, even though many of the creatures in D&D more closely resemble their Tolkien counterparts than the original mythic inspiration.
However, copyright law is potentially much more complex than that. For example, the estate of Arthur Conan Doyle argued, in a recent case against Netflix, that while the character of Sherlock Holmes is out of copyright, certain personality traits only appearing in later, in-copyright Sherlock Holmes works (such as displaying empathy) are still under copyright.
In theory, Wizards of the Coast could sue over similarities to their specific versions of individual monsters. For example, they can't own copyright on "troll", but could arguably claim copyright on a troll who regenerates injuries unless burned with fire.
In practice, Wizards of the Coast is generally lenient with the use of monsters inspired by earlier works, even where D&D's characterization of those is original.
A good example of this is the lich. Earlier fantasy works used "lich" (an archaic word for a body) to refer to an undead body found in a tomb, but D&D's specific conception of the lich as a magic user who keeps their soul in a phylactery is largely original. This conception of the lich has in turn been used by other works such as World of Warcraft, and as far as I'm aware, Wizards has never tried to sue over it.
Wizards is stricter regarding certain creatures which it considers Product Identity; i.e. original creations owned by the company. These include the beholder, gauth, carrion crawler, displacer beast, githyanki, githzerai, kuo-toa, mind flayer, slaad, umber hulk, and yuan-ti, all of which appeared in the D&D v.3.5 Monster Manual but were omitted from the SRD on copyright grounds. Even then, some video games have gotten away with using these creatures; the mind flayer in particular appeared in Demon's Souls and the Final Fantasy series. Still, I wouldn't recommend using these creatures in a game, as WotC have explicitly declared that they own copyright on them, which suggests they reserve the right to enforce that copyright.