the electoral college is under on legal action to follow a states popular vote.
Selection criteria for electors and their responsibilities vary by state, but each party running for president has its own pool of electors. In most states, the electors who will determine the final count of votes toward the presidency are selected in a winner-take-all fashion based on the popular vote. That being said, while it's
possible that an elector may choose to split from his/her party and vote for the other guy, it's pretty unlikely.
The wildcards in the process are Maine and Nebraska. Those two states do not select electors based on winner-take-all.
In any event, the important thing to remember is that when you cast your vote for President, you are not actually voting directly for your favorite candidate. Rather, you are voting to decide which pool of electors will be voting in the Electoral College for your state.
(We could throw another wrench in here by mentioning that the Electoral College does not formally make its decision until they vote on the first Monday after the second Wednesday in December. And in the event that there is no absolute majority of votes cast by the Electoral College, the President is elected by the House of Representatives and the Vice President is elected by the Senate.)