The Democratic and Republican parties can choose their candidates by either a primary election or by a party meeting. If a party uses a primary, it will be held on the second Tuesday in June. A presidential primary, if held, will be held the first Tuesday in March in the year in which a presidential election takes place.
If you are a registered voter, you can vote in any primary election. If both parties are holding a primary in your election district, you can vote in only one party's primary.