After defeating Ultra Necrozma, you will be permitted by the Ultra Recon Squad to continuing using there Legendary Pokemon to travel through Ultra Space. As you do this very thing, there is a chance you will travel to the Ultra Deep Sea and find Nihilego. Like all Ultra Beasts, Nihilego has some pretty incredible stats. It's more of a Special Pokemon, with high stats in both its Special Attack and Special Defense, but it's also quick and bulky with nice Speed and HP.
You will always find and battle Nihilego at Level 60. Like most Legendary Pokemon, it's best to try to Paralyze Nihilego with the move Thunder Wave, making Nihilego much easier to capture. From there, try to lower Nihilego's HP as low as you possibly can. A move like False Swipe works great when it has low HP, ensuring to leave it with at least one HP. If you have the Rotom Power that makes it easier to catch a Wild Pokemon, then you should definitely consider using it here as well.
But do watch out, for the more Pokemon Nihilego knocks out on your team, its Highest Stat will increase every time it does so because of its Beast Boost Ability. Because of this, like all the other Ultra Beasts, it's best to try to capture it as quickly as possible with Beast Balls, since they have a x5 Catch Rate when used on Ultra Beasts. And don't forget to ALWAYS save before trying to find Nihilego. It's a safety precaution, one that has worked since the first generation of Pokemon.