Legally changing gender?

I’ve been trying to research this and I’m still really confused so I’m hoping one of y’all will know — what’s the process for having your gender legally changed in the US??

From what I’ve found I need to go to court to change my SS which is fine, but do I also need to change my birth certificate? How does this work if I don’t live in the state I was born (AL to MD)? Also, if so, Alabama requires “gender reassignment surgery” but what counts as reassignment in this case? I want to get these things done before Jan 20th as a precaution. My drivers license has an X marker because that’s very easy to do in Maryland, but I plan to change it to an M marker when I renew it in the next few months.

Do I need to get a lawyer to do all this? Because I honestly don’t know if I can afford one rn but I want this done asap.