Former President Barack Obama is poised to plunge into the fray of the midterm campaign, returning to electoral politics with a frontal attack on Republican power in two states that are prime Democratic targets this fall: California and Ohio.

Having largely avoided campaign activities since leaving office, Mr. Obama’s first public event of the midterm election will take place in Orange County, a traditionally conservative-leaning part of California where Republicans are at risk of losing several House seats. And Mr. Obama is expected to be joined by Democratic candidates from all seven of California’s Republican-held districts that Hillary Clinton carried in 2016.

Mr. Obama intends to campaign next Thursday in Cleveland for Richard Cordray, a former bank regulator in his administration who is the Democratic nominee for Ohio governor. Republicans have held total control of the state government since the 2010 election, and Mr. Obama helped encourage Mr. Cordray, also a former state attorney general, to seek the governorship.

The former president’s return to public politicking comes at a momentous point in the 2018 election season, furnishing Democrats again with one of their most formidable and popular campaigners in the closing months. While Mr. Obama has addressed several fund-raising events and issued a list of endorsements, he has otherwise confined his public appearances this year to loftier venues than the campaign trail.