I am a resident of AZ, living in MA, employed in NH. I will not be a resident of MA for this calendar year. I am currently paying income tax in MA. What do I do/fix?

I moved to Massachusetts in September. The house I am staying at is not in my name. I do not plan on filing as a resident until next year as if I understand correctly I have to be in a state for 183 days to be considered a resident. I am working in New Hampshire and the state income tax coming out of my paychecks are being paid to MA. Should I switch this to be paid towards AZ state income tax? Also what do I do about the amount that has already been paid. Is there any other information that I should know or might be helpful? Any help is greatly appreciated.