Confused about NCLEX and Different States

So if I studied nursing in, let’s say, New York and I passed the NCLEX there and got my bachelor’s degree in New York, would I be able to come back to California and work as an RN? How does the whole moving states situation work?

It is a national test. Each state provides the licensing, but it is only a matter of paperwork to transfer from one state to another, once you are licensed by one state.