He didn't the last time.
“How did Arpaio win in the populous county for which he was sheriff? “
You mean Maricopa County, one of the most conservative in the state?
“Every Republican presidential candidate has carried Maricopa County since 1948. This includes the 1964 presidential run of native son Barry Goldwater, who would not have even carried his own state had it not been for a 21,000-vote margin in Maricopa County. It is currently the largest county in the country to vote Republican.”
https://en.wikipedia.org/wiki/Maricopa_County,_Arizona
In 2016, Democrat Paul Penzone beat him for Sheriff by a margin of 56-43. Four years earlier, Arpaio won with 51% of the vote. He can’t carry Maricopa, let alone the rest of the state!