“Ideally, we’d like to move completely out of state,” said Raeann Haggard, 29, who lives in Bakersfield with her wife and three foster children. Ms. Haggard said that two of those children suffer from asthma, and that the smog of Bakersfield makes them sick, especially in the hot summer months.

“Their quality of life, I feel, is horrible during the summer and spring,” she said. “They can’t play outside.”

Rising gas and health care prices — which collide for her family because she has to take the children outside of Bakersfield for frequent medical appointments — have pinched the household budget. She had to give up the family’s cherished season passes to Disneyland, and sell her Chevy Silverado truck because it was such a gas guzzler. Ms. Haggard said she will vote in the Democratic primary, but she would not say for whom.

Meanwhile, Stockton, an impoverished city east of San Francisco that was one of the hardest-hit places during the 2008 economic crisis, has been testing a universal basic income program, giving 125 residents $500 per month. It is an idea that was championed by Andrew Yang, a tech entrepreneur who dropped out of the presidential race in February.

“Cost of living just keeps going up, up, up and the wages didn’t keep up with that,” said Virginia Medina, 62, who has been receiving the extra income and using it to pay down credit card bills. Ms. Medina voted for President Trump in 2016 and said she will do so again. (In 2016, Hillary Clinton won big in California, receiving over 4 million more votes than Mr. Trump.)

In San Francisco, a liberal city awash in tech industry riches, the inequality crisis is particularly acute. The city has a budget larger than those of many countries. Yet the public school district is preparing to lay off teachers.

Greg Espy earns $25 an hour working security for the school district. He also coaches football. But to get to school on time he needs to leave his house in Pittsburg, across the Bay from San Francisco, at 4:30 a.m. Gas and tolls alone cost him $6,000 a year, a big chunk of his salary.