You need a backend, a piece of software that runs on a server and communicates with your website (the piece that runs in the browser is called a frontend).
I don't know how much of this will go over your head, but the general idea is: your backend is an http server, that exposes API calls: basically functions you can run by invoking them from the frontend. They would usually return json data that you can then parse in js in your frontend and display it.
A partial simple example for a polls backend API structure would be something like this:
- GET /polls: returns a list of all polls
- GET /polls?status={active|inactive}: returns a list of all active/inactive polls
- GET /polls/123: returns the poll with id 123
- PUT /polls/123?vote=2: vote on poll 123, with choice number 2
And then other authenticated API calls that only an admin can run to create, delete and close polls.
You could also want to limit access to these APIs by IP for example, so that the same person cannot vote twice. Of course using the IP has limitations, but there are alternatives, including requiring user registration.
The data would need to be stored in a database that your backend will need to communicate with to persist all of this data.
You would also need to think about security since this would need to be hosted on the public internet you want to make sure it's secure.
For user security you would also likely need to add an SSL certificate to enable https. Usually you do this by serving your backend through a reverse proxy like nginx.
To summarize, this sounds like an easy thing to do, particularly considering how easy it is to create a static backend-less frontend, but in reality it involves creating a full on application.
It's definitely not hard per se, and honestly if you're interested I'd encourage you to learn how to do this cause it's a lot of fun, but it's absolutely not on the same level of difficulty as creating your first neocities website.