During a Nuzlocke in Ultra Sun, I got walled by Ultra Necrozma because Ultra Necrozma is a massive piece of shit.
So I looked up the battle and found this neat little method from a forum somewhere.
Using Zorua, you send it out Illusioned as another Pokemon that is not a Dark Type so Ultra Necrozma is fooled into spamming Photon Geyser, which will do no damage to Zorua. Get off a Toxic and stall out until Necrozma dies.
I got unlucky with Necrozma eventually using Smart Strike, but it was weak enough that I finished it off anyway.