Hello! Your friendly neighborhood Election Lady here. This may come a bit late for you, as primary season is coming to an end, but my state primaries late. And there will always be more primary elections, so it's not like you'll never need to know what I'm about to tell you.
It's a Very Good Idea to look up whether your (U.S.*) state is an open-primary, closed-primary, or modified-primary state, and to do this before you vote.
Primary: This is the intra-party election, where each party decides who its nominee for the general election will be. They are held several months before the general elections. You get Democrats running against Democrats, Republicans running against Republicans. (Very few of the true third parties are big enough to need primary elections.)
Open primary: This is a primary election in which anyone can vote, regardless of whether you're registered with a party or which party you're registered with. You do have to swear that you will vote in only one (1) primary, though.
Closed primary: This is a primary election where the only people allowed to vote in a party's primary are people who are registered as members of that party. Only registered Democrats can vote in a Democratic primary; only registered Republicans can vote in a Republican primary. If you are a registered Independent, or you're registered to vote without a party affiliation, you cannot vote in a closed primary.
Modified Primary: Mostly an open primary, but each of these states has some kind of restriction on who can vote in a primary. Often this looks like registered Democrats and Republicans only being able to vote in their party's primary, while unaffiliated votes can choose to vote in one (1) primary for either party.
This applies to primary elections only. If you are registered to vote, you can vote in the general election, and you can vote for whomever you like. If you are a registered Democrat, you are entirely free to vote for a Republican or a third-party candidate if you want. It's a secret ballot; nobody will know who you voted for but you (and anyone you choose to tell, of course). If you feel like the two major parties don't represent your views, you are perfectly free to register as an Independent or register as unaffiliated and cast your vote for your favorite candidate. In the general election.
If you live in a closed-primary state, you must be registered as a member of a party in order to vote in that party's primaries. In the primary, it does not matter how reliably you vote for that party's candidates. You could be a registered Republican who always always always votes for the Democrat, and you would still not be allowed to vote in the Democratic primary in a closed-primary state.
If you live in a closed-primary state, and you want to vote in primaries, you must register with a party when you register to vote. It's often one of the ticky boxes on your voter registration form. You can, of course, always change your party registration -- in my state, that's just filling out another voter registration card, tickying the box that says "Party Change," and then tickying "YES" for the question "Do you want to register with a party" and tickying off which party you choose. That is the very simple thing that will allow you to vote in a primary election.
Why would you want to register with a party when you genuinely feel that none of them represent your views? Well, that's where the party's candidates are chosen. If you want a say in who gets nominated -- I'm talking to the "the Democrats/Republicans never choose the best candidates, how can I possibly vote for these sanitized, corporatized stuffed shirts?" people here -- then you want to vote in the primary elections, because you want to have a voice in selecting the good candidates. And there are some places where a whole election truly can be decided in the primary rather than in the general!
In a closed-primary state, you must be registered with a party to help it choose its candidates. So, if you don't feel that any party represents you, then pick the party whose candidates you'd like to have some say in choosing.
Some states have same-day voter registration, but that often does not extend to party changes. In my state, we can register you to vote and vote you on the day of the general election (though this service is only available at places like City Hall, not at your local polling place, and lines can be long). But we cannot process a party change that fast. At the polling place where I work, I can give you a party change voter card to fill out, and you still can't vote in the primary that day, because I give the card to the moderator, who will take it down to City Hall after the polls close. Your party change cannot be processed while we're all working at the polls, so on the day of the primary, you are still not registered with that party. Sorry.
Your best course of action is this:
A. Know that a primary is coming. There will be signs. Literally. On people's lawns.
B. Look up whether your state has open, closed, or modified primaries. You could Google this, looking for websites that end in .gov for the true answers, or you could call your local Registrar of Voters; that office exists to answer questions like this.
C. If it turns out that you need to be registered with a party to vote in a primary, check your voter registration to see if you're registered with that party. Again, this is probably going to be a call to the local Registrar of Voters. They'll probably ask you for your date of birth, your street address, and your name.
D. Do all of this before Primary Election Day. It does take a little bit of time to process a party change, if you need one. I'd suggest doing this the week before the election, just to give time for the party change to go through and for the Registrar of Voters to get your name on your district's voting rolls so that you're all properly listed on Election Day.
If you do all of this, your election experience may be as simple as showing up, giving the checkers some ID, getting crossed off the list, getting your ballot from the ballot clerk, voting, dropping the ballot into the box/tabulator, and getting your "I Voted" sticker. On a slow election day, this could be about fifteen minutes out of your day.
The alternative is this: you show up at the polls, and the checkers don't have you on the list. You get sent to the assistant registrar (that's me!), who will take the time to see if you're on the inactive list, and if not, if you're in the right polling place. Depending on how the day is going, I might ask you upfront what your party registration is. Maybe you don't know. Maybe you were under the impression that because you're registered to vote and you always reliably vote for $PARTY, it's fine. I then call the Registrar of Voters, give them your date of birth and your name. And the most common answer that they give me in a primary? "This voter is unaffiliated."
At which point, I will offer you the chance to affiliate with a party by filling out one of the voter cards I have at my table. But, because that card isn't going to the Registrar of Voters until after the election, you won't be voting that day. And you will leave, disappointed that you could not complete this errand. (We will still be happy to see you at the general election, though!)
So, the TL;DR is: If you want to influence a party's selection of candidates, learn your state's primary status, and register with a party before the primary.
This has been a Friendly Neighborhood Election Lady PSA!
(P.S. If there is a hornet nest outside the polling place, go to another entrance and let the moderator know. The moderator will take care of the hornets. Ask me how I know this . . . )
*I'm in the United States, and I vote and work at elections in the United States, so this message is aimed at United States citizens. Everyone else has no homework today.