If the electoral vote is a tie, giving each candidate 269 votes, which is an extremely rare chance, the House of Representatives decides who will be the President. In this case, each state, even California with its huge 54 electoral votes, gets only 1 vote. This also has happened in the history of our country. Thomas Jefferson in 1800, John Quincy Adams in 1824 and in 1876 Rutherford Hayes were all elected by the House. The Senate decides who the Vice President will be in such cases.
Senators vote individually.
So it is possible to have a Republican President and Democratic Vice President, or vice versa. None of this can happen before the new Congress is elected and then sworn in, meaning in January. This election, which is supposed to be very close, might end up being very interesting. The three branches of the government are the Executive, Judicial, and Legislative. The chief Executive is the President.