The national popular vote doesn't affect the results of the Electoral College at all, but the answer regarding the popular vote is more nuanced than that. In the United States, each individual state conducts their own election; the winner of each state's Presidential election is chosen by whoever wins the popular vote in that state.
There are 538 Electoral College votes that are awarded to candidates in the Presidential Election. This number is achieved by adding up all the members of the House of Representatives and Senators in Congress, and 3 additional seats for the District of Columbia; there are 435 Representatives in the House, 100 Senators, and 3 electors awarded to D.C, equalling a total of 538. A specific state's number of Electors is based off of the sum of the number of the state's Representatives in the House plus the state's two Senators.
Electors are individuals sent by each state to represent it in the Electoral College, the body which chooses the President of the United States. The qualifications required to be an Elector are quite low; the only prohibiting factors are holding any political office and having participated in an insurrection against the government. Before the election, each state party nominates Elector candidates— usually approving them at a state party convention or some other event. When election day arrives and a candidate wins a state, the party of the winner's nominated Electors are chosen to represent the state in the Electoral College (4).
A candidate wins Electoral votes by winning the popular vote in individual states (or, in some special cases, by having a significant performance in the state). In general, if a candidate wins the popular vote in the state Presidential election, he or she will be awarded all the Electoral votes for that state; the candidate's party will send their electors to represent the state in the Electoral College.
A winner is declared in the Presidential election when a candidate has (or is projected to have) at least 270 Electors voting for them in the Electoral College. This constitutes a simple majority of all Electoral College.
If any of these two scenarios occur, the House of Representatives and the Senate will then vote to decide the winner. The House has the power to select the President; each state's delegation of Representatives get one vote each. Voting occurs until a majority is reached. The Senate, meanwhile selects the Vice President. Unlike the House, each Senator votes individually for Vice President. A simple majority of Senators is required to select a new Vice President (5).
The 12th Amendment codified the current system of the Electoral College that we have in the United States. It dictates that Electors vote for filling of the separate offices of President and Vice President, which did not occur before the time it was ratified. It also changed the way proceedings were conducted if a candidate failed to get a majority in the Electoral College; instead of the top five, the House would vote on the top three candidates to declare a winner, with the Senate deciding the Vice Presidency (6).