The popular election is over. Now what? In a report at https://crsreports.congress.gov/product/pdf/IF/IF11641
An objection to a state’s electoral vote must be approved by both houses in order for any contested votes to be excluded.
If one of the tickets has received a majority of 270 or more electoral votes, the Vice President announces the results, which “shall be deemed a sufficient declaration of the persons, if any, elected President and Vice President.” If not 270 votes for a ticket, Congress is in charge and results are determined. This has happened several times in history. The president is not elected until congress accepts the results?
For additional information, see CRS Report RL32717, Counting Electoral Votes: An Overview of Procedures at the Joint Session, Including Objections by Members of Congress, coordinated by Elizabeth Rybicki and L. Paige Whitaker.