After defeating Ultra Necrozma, you will next find a weakened Necrozma in the middle of Mount Lanakila. It will ask for you to share some of the light from your Z Ring, and if you are so kind, you go in battle with it. This time around, you will finally be able to capture it. Like many other Legendary Pokemon, Necrozma makes for a very difficult capture. To start, odds are it will be equal or higher than most of the Pokemon on your team, sitting at a pretty decent Level 65. And let's not forget the defensive capabilities it has, plus its exclusive ability of Prism Armor that weakens all Super Effective Attack you use on it. Yeah, this thing won't be easy unless you're using a Masterball on it, which isn't at all necessary. (But you can if you'd like.)
As like most Legendary Pokemon that don't have the highest of levels, you should definitely only be using Ultra Balls on Necrozma, but only after getting its HP as low as you possible can. This can be incredibly difficult to do, since it won't have any problem crushing all sorts of holes in your team as you do. And that's why you need to have more than the average amount of Ultra Balls, Revives and Max Potions on hand when facing it.
False Swipe is also a nice move to have on one of your Pokemon, guaranteeing that Necrozma will be left with at least one HP, should you have the TM or a Pokemon that knows it. Thunder Wave also works best as status conditioning to make Necrozma easier to catch, since it's permanent (unlike sleep) and it doesn't cause Necrozma to lose any HP (much like a burn). 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. And don't forget to ALWAYS save before facing Necrozma. It's a safety precaution, one that has worked since the first generation of Pokemon.