How do I get refunded on the taxes as a NY resident but working in CT, if I am getting double taxed by both NY and CT?

Hi,

I am looking for some suggestions and steps that should be taken before filing taxes.

I have moved to Connecticut for my first job from NY. I am originally from NYC and am a NY resident. Currently I am paying taxes for both states, which arouses some questions:

- Because I am working in CT, shouldn’t I be refunded the NY tax? How much do we get credited, is it the entire tax charge? When do we get credited, is it with our tax return?
- Do I pay NY tax because I am a NY resident or Do I pay CT tax because I am working in CT?
- What needs to be done or which form needs to be filled out to process this credit?
- What does withholding taxes for a state mean?

In gist what steps must be taken to avoid the second state tax that is being paid on every pay intervals and how to get a refund on these taxes.

Any suggestion helps, thanks!