Just because you aren’t on the surface of Earth, doesn’t mean you don’t perform your civic duty!
Three astronauts are currently aboard the International Space Station: NASA astronauts Josh Cassada, Nicole Mann and Frank Rubio.
A few years ago, US Astronaut Kate Rubens answered this question during an online Q&A, saying it’s very similar as to what other government officials do when they are overseas. They fill out an application before their departure, receive the ballot electronically aboard the ISS, and send back their votes via encrypted e-mail.
Interestingly, most astronauts vote as Texas residents, since most move there for training. Texas actually has special laws enacted to address astronauts voting from space.
If this interests you, you can read more about it in this article from Space.com.