Married but living in separate states (NJ/NY)

Hi! Just got married in 2023 but we both lived in separate states for 2023. I lived in NJ and my husband lived in NY. We both earned income in NY and I run a side business in NJ. Wondering the best way to file our tax returns. Was looking to do join returns but not sure if/how to do that if we lived separately. Any help is greatly appreciated!