If somebody more senior than you tells you to do a thing a certain way and you don’t understand why they think their way is better, ask them to explain it, but do it in a polite way. Asking the question shows you’re engaged in the process and not afraid to share your own input.
If you hear the explanation and still disagree, let it go and do it their way. Even if they’re wrong, they won’t want to hear about it from you at that point. You win some, you lose some. Being able to disagree and commit is huge.