MTB, basically if there are hills involved you want more bottom end, so 36.
I’d only be looking at smaller if I was only doing flat stuff, xc racing on the flat, or purely DH.
Those all start at 11 at the top end and with the triple up to 42 you’ll get loads of flat speed, though likely you’ll only see that on the road. If you’re favouring off more than on, I’d consider not bothering with a triple as you may not use the big ring much if at all.
Have a play with gear ratio calculators online also. If you know a set up that you’re used to, put that in and play about with different options to see what ratios you gain or lose. Likewise try it with 2x or even 1x and see what a difference that makes.
p.s. 9 speed, 10, 11 ?