Choosing depends on what you want to do.

Using masked language modeling is good when you want good representations of the data with which it was trained.
Next sentence prediction, or rather causal language modeling (such as GPT), are better when you want to focus in generation.

The course has a section in how to fine-tune a masked language model that could be interesting to you: Main NLP tasks - Hugging Face Course 6.