Remember, Americans don’t directly elect the president. The electoral college does: Slates of electors pledged to support presidential and vice presidential candidates are voted upon in each state every four years. Each state, and the District of Columbia, is apportioned at least three of the 538 electors, allocated by the total number of U.S. senators and House members each state has.

In December, these electors will gather in their respective states and cast votes for president and vice president.

And in January, Congress counts these votes, determines  if a candidate has achieved a majority — at least 270 votes — and then certifies a winner.

https://www.washingtonpost.com/posteverything/wp/2016/03/17/if-no-one-else-stops-trump-the-electoral-college-still-can-its-in-the-constitution/?utm_term=.6d3e8686b602