Now, both parties believe that Arizona, which Mr. Trump won by about 90,000 votes, or 3.5 percentage points, is in play in the 2020 presidential race. Who wins will come down, in no small part, to places like Chandler, with its well-educated independent voters.

[Sign up for our politics newsletter and join our conversation about the 2020 presidential race.]

Mr. Maiefski and his girlfriend, Tricia Mitchell, had passed a roofing crew in their neighborhood laboring outdoors in 103-degree heat. “They work harder than anybody,” Ms. Mitchell, an analyst for a tech firm, said of immigrants.

Ms. Mitchell did not vote in 2016. But she plans to show up next year — to cast a ballot against the president. She has a Hispanic daughter from an earlier relationship, and ever since Mr. Trump’s election, she said, her daughter has faced racial hostility.

To Democrats, the importance of making inroads in the Sun Belt followed the thunderclap of 2016, when Mr. Trump’s appeal to white voters without a college degree won him Rust Belt states that had seemed permanently out of Republicans’ reach.

If the president is able to hold on to even one of the so-called blue-wall states he won in 2016 — Michigan, Wisconsin and Pennsylvania — Democrats must find somewhere else to win.

To many analysts, Arizona could be that somewhere else, thanks to the influx of college-educated transplants and the mobilization of Latino voters, especially young Latinos, whose turnout in 2018 was higher than the 2016 presidential race — highly unusual for a midterm.

“This is not your dad’s Arizona anymore,” said Chuck Coughlin, a Republican consultant in the state. He said Midwest retirees, the traditional conservative base, were aging and being replaced by younger, more diverse and independent voters.