Article Two of the United States Constitution
Under the U.S. Constitution, the President and Vice President are chosen by Electors.  The Constitution allows each state legislature to decide how they will choose Electors.  Since the 1820s, state legislatures have usually chosen Electors through an indirect popular vote.  This means that people in the state will get to vote on which Electors they want.  The ballot that people use to vote will have the Electors' names on it.  Usually, it will also say what Presidential and Vice Presidential candidates they plan to support.  This allows the people to choose Electors who support the candidates they like.