Can i do both simultaneously??
Often these degrees are joined together in a common admissions process to get a joint MS/PhD, but the degrees are done consecutively and the MS is picked up in passing. Some schools/programs separate the two. While schools are different it is often the policy that faculty prefer to fund those masters students who want to do a PhD.
If you think that’s the path for you, think very carefully about the choice of advisor and get someone who is both established and willing to invest in you. It’s a difficult thing to do, but that relationship should be built well before applying.
If you treat this like a job search you’re thinking about it the right way.