Both are effective, but you should do what's comfortable for you. Seated climbing is easiest for most people because the seat supports your weight. When standing, your legs support your weight meaning greater energy expenditure.
Standing is a good skill to have when the terrain gets vertical however, because it allows you to gently rock the bike and use your body weight to pedal. Also, when standing, you're giving the muscles you use when seated a rest. And, riding off road, standing changes how much weight is over the front of the bike, which can help keep the front tire on the ground when you're working up a steep climb. So, standing can come in very handy.
Our recommendation is to practice, and get good at both types of climbing so you have two reliable methods for scaling hills that you can use when needed.