If a sacrament imparts grace, why did Jesus get baptized?
The other thing you're missing is the sequence of events. The Biblical model is belief first then baptism.
I know the answer to this but I’m going to ask you. If you die and are not baptized with water, can you still go to heaven?
“If a sacrament imparts grace, why did Jesus get baptized?”
John the Baptist asked Jesus that, didn’t he? He said, “I need to be baptized by You, and are You coming to me?”
“But Jesus answered and said to him, “Permit it to be so now, for thus it is fitting for us to fulfill all righteousness.”