The parties choose their nominee formally at the convention which was in the Summer. The GOP nomination process was done as a democracy, they had a field like 5-7 candidates that performed well enough in the opinion polls to be invited to the first few debates, take note Trump though invited did not attend any of the debates but attempted a grassroots campaign. This phase, the primary campaign phase took place last year cultivating the candidates and giving them platform to debate and make their case, most dropped out before the primary elections then in this year's past Winter and Spring. Trump overwhelming won the elections they all dropped out leaving him as the nominee, though he still easily met the threshhold for election wins regardless, really he blew out the primary polls this cycle. The democrats basically rigged their own primary so that Biden had no real challenger, and ostracized some of their party like RFK Jr. whom then ran as an independent. Then of course after Biden malfunctioned in the first main season debate against Trump the democrats pretty much threw all their elections in the trash and outright appointed Kamala to the nomination in the Summer. This is how the nominee for the GOP became Trump and the democrats became Kamala.