Question about voting in New York

I’m trying to find out something about voting in NY — for some reason, no one seems to know. So I’m hoping one of y’all does.

New York has had issues with registered voters not being on the lists at the polling places. When your name isn’t on the list, you can either cast an affidavit ballot, or you can go get a court order allowing you to vote normally. 

I wasn’t on the list when I went to vote in the primary election, even though I was registered. (And I had my voter registration card with me). I cast an affidavit ballot. My vote ended up not counting, because I filled out the form incorrectly.

I want to make sure that my vote counts in the general election. (And that everyone else’s does too.) So, if I am not on the polls on election day, I want to get a court order this time around. But I don’t how how to do that — and no one else I’ve asked seems to know either.

If someone is a registered voter in NY, but not on the list at their polling place on election day, they have the right to get a court order allowing them to vote. Does anyone know how one goes about doing this?`