There is no direct way
For some damage types, there is a way to overcome resistances. Specifically, the Elemental Adept feat does this for exactly one of acid, cold, fire, lightning, or thunder damage. It’s conceivable that there someday be an equivalent for necrotic damage, but it does not exist at the moment.
This situation is a result of monster categories
Most campaigns are more likely to run against mobs of undead than mobs of celestials. That’s a result of the fact that most campaigns follow good characters, who are unlikely to fight angels but quite likely (for example) to fight a dracolich.
It makes sense that many of these creatures would be resistant to necrotic damage, just as using fire damage would be ineffective against a fire elemental.
The fact that these monsters appear in great numbers in the Monster Manual is a reflection of this tendency. It’s not necessarily a reflection of what you’ll see in practice. If your campaign doesn’t focus on fighting undead, you simply won’t run into this problem. If your campaign does focus on fighting undead, it’s not as a result of a bias in the Monster Manual, but a result of the campaign setting.
Either way, the solution you should consider is the same. Diversify your damage types. Even an evil mage will understand that sometimes they’ll fight a rogue specter or wraith from time to time, and should prepare accordingly. In fact, a spellcaster who is *ahem* intimately familiar with undead will be more aware of this fact than your average mage.