DIXIE NATIONAL FOREST, Utah — “The object is to keep ’em grazing,” Scott Stubbs said as he looked over the 1,470 ewes and lambs chewing up Castle Valley’s dandelions, clover and grasses. “Get them full, which makes them fat.”Mr. Stubbs, a fifth-generation sheep farmer in southern Utah, did not expect to be giving a hands-on shepherding seminar this summer, but he was stuck. He needed a second experienced herder, and the one who was supposed to arrive in the spring from Peru did not get approval for a special agricultural visa. Now backlogs at some foreign passport offices and American consulates — compounded by the pandemic — were delaying a replacement.That’s why Mr. Stubbs last month ended up hiring Duane Rogers, a type of worker rarer than a blue lamb in these parts: an American-born beginner who was eager to herd sheep.Labor shortages are common this summer, especially in Utah, where the unemployment rate is 2.7 percent. The Marriott in Cedar City did not have enough maids to offer daily housekeeping, and the Denny’s outside of Beaver had a sign on the door asking customers to be patient with a short-handed staff. But the predicament that Mr. Stubbs and farmers like him are facing is of longer standing and more severe.“Nobody wants this type of work,” Mr. Stubbs said of herding and farm labor. And most American-born workers haven’t wanted it in a while — at least at the wages that most farmers say they can afford. That is why more than 200,000 temporary foreign farm workers, mostly from Mexico, were allowed into the United States last year to pick cherries, tomatoes and tobacco or to tend livestock. The number of visas issued has more than tripled since 2011, and it increased in 2020 despite the pandemic, after food and agricultural workers were characterized as part of the essential work force.Mr. Stubbs, 54, started using the agricultural visa program, known as H-2A, eight years ago. Through an agency, he hired a Peruvian, Ronal Leon Parejas, who is still with him.Before then, aside from family members or the occasional high school student who would pitch in for a few weeks, the only people in recent years willing to herd sheep were Native Americans or undocumented immigrants, Mr. Stubbs said. This year, the Navajo herder who had been working for him needed a knee operation. At 68, he probably wouldn’t be coming back.“You put a small flock out, but you can’t get labor,” said Mr. Stubbs, who raises his flock for both wool and meat. “It’s putting a hurt on.”Mr. Stubbs, who was 5 or 6 years old when his grandfather taught him how to move a flock from meadow to creek on the federal forest land where his family has had grazing rights since the 1800s, knows it is a hard and lonely job. His first month herding alone was after eighth grade. “I thought I would die,” he said, even though his mother drove from their farm nearly 20 miles away each day to check on him. “I lost 30 pounds in 30 days.”A herder has to stay with the sheep 24 hours a day through the roughly 10-month period on the open range, in sun and rain, hail and snow, whether temperatures climb toward 100 degrees or drop below zero. The workday begins at sunup and ends at sundown, although there may be nights when you need to help the guard dogs scare off a coyote or a mountain lion. There are no weekends or holidays off.The H-2A program has been criticized for low wages and lack of worker protections. For workers under the visa program, the pay is set by the government, and has increased in recent years. In Utah, it is $1,728 a month plus transportation, room and board. In this case, the room is a 14-by-8-foot sheep wagon that has a bed, a wood-fire stove, a gas grill and a cooler. Mr. Stubbs delivers requested food — eggs, bacon, sandwich meat, bread, potato chips, cookies, soda and cans of chile and corn — every few days, along with water.And that is the deal that Mr. Rogers accepted three weeks ago. “I’m grateful that Scott gave me a chance,” he said.Mr. Rogers prepared dinner in his trailer near the grazing area where he herds sheep.A herder has to stay with the sheep 24 hours a day through the nine-month grazing period.Marty Stubbs, who is training Mr. Rogers, roped a lamb that was showing signs of a possible injury.Mr. Rogers, left, assisted Mr. Stubbs with the injured lamb.Mr. Rogers pulled on his tan leather gloves. “I love being in the mountains, and I don’t mind being alone,” he said. His wife, whom he met a few years ago on Western Match, an online dating service for cowboys and “country folk,” lives in South Texas with his stepson and two step-granddaughters. He arrived in Utah with five dogs and his father’s old saddle.At 58, Mr. Rogers has tried his hand at various jobs. He grew up in Hayden, Colo., where his father owned a small farm and raised some cattle and sheep. He served in the military for 12 years and did a tour in Panama before joining the National Guard. In addition to herding cattle and working as a ranch hand, he has driven trucks, maintained highways, worked in construction, plowed snow and guarded women and children who had been arrested at the border and locked up in Immigration and Customs Enforcement detention centers — a job he said he hated because of the conditions.During a long rehabilitation after a truck wreck in 2017, Mr. Rogers said, he spent a lot of time thinking about what he wanted to do. He had looked after small flocks of sheep in enclosed areas, but the idea of working a large open-range herd had always exerted a magnetic pull. He was fascinated by the nomadic life, and had watched dozens of documentaries about it. And he was excited to train his dogs to herd sheep.He was unemployed when he saw the advertisement on the state’s job listing site and applied.“I like cattle, but sheep are a lot more entertaining,” and a lot smarter than people give them credit for, he said. “The lambs do some of the funniest things. In the morning, when they’re feeling good, they’ll climb up on the rocks and play king of the mountain.”The sheep were offering a symphony of guttural bleats punctuated with hollow tongs from bells dangling round their necks as Mr. Rogers and the dogs directed them toward a noonday water break. As the ewes and lambs shuffled forward, they kicked up swarms of grasshoppers that can strip a green field faster than any herd. It is one of several travails plaguing Western farmers this season, along with extreme heat and a prolonged drought that are shrinking harvests and killing off grazing land.The delay in hiring a second herder provided Mr. Stubbs with another challenge. Because he had no one to take the sheep to graze, he had to keep them on the farm, feeding them bales of hay he might otherwise have sold.Over the past few weeks, his son Marty has been helping train Mr. Rogers to herd, so he has not been around to help his father with farm work or tend to his own sheepshearing business. There are many days, Mr. Stubbs said, when he and his teenage daughter ended up working till midnight.One morning, Marty Stubbs caught sight of a small white lamb that wasn’t using his hind left leg. He rode after him, threw up a loop of rope and in a single swing lassoed his back legs. He jumped off a chestnut horse named Trigger and held down the lamb, pushing his left knee against the animal’s stomach. He examined the hind hoof, poking with a knife to loosen a stuck rock or thorn.Mr. Rogers took a brown bottle of penicillin and a large syringe out of his saddle bag.“How many CC’s you want?” he asked.“Six,” Marty replied.He closed his knife, took the needle and jabbed it into the lamb’s hindquarter and then marked the animal’s back with an orange line in chalk. He lifted his knee, and the lamb hobbled away.“If you know where they’re going, it’s OK,” Marty said of keeping track of the sheep. “The problem is if you don’t know where they are and you have to find them.”Knowing where the flock is likely to head, though, is something that only comes through experience. Mr. Parejas said it wasn’t until his fourth year that he felt truly comfortable.His herd was about 10 miles east of Mr. Rogers’s, and he was getting ready to move them across Highway 143, through thick clusters of pinyon pine and juniper, spruce and white quaking aspens, up Haycock Mountain. As the sheep fanned out across the road — they have the right of way — lines of cars and trucks backed up on either side of the double yellow line, their passengers alternately irritated and enchanted by the woolly procession.Sheep herded by Ronal Leon Parejas, a Peruvian herder, crossed Highway 143. Mr. Parejas, left, has not been able to return to Peru to visit his 4-year-old son since February 2020, before the pandemic hit.“It’s very hard and very lonely,” he said through a translator. “I miss my family.”Juan Arredondo for The New York TimesFor Mr. Rogers, left, the idea of working a large open-range herd has always exerted a magnetic pull. Mr. Parejas, 32, has not been able to return to his own small farm in Peru or his 4-year-old son since February 2020, before the pandemic hit. He hopes to visit in December, when the season ends, as long as it doesn’t interfere with his efforts to get a green card — a prize that would enable him to work and live in the United States without restrictions.“It’s very hard and very lonely,” he said through a translator. “I miss my family.” Still, it is better now than during his first couple of years, when he lacked a cellphone with WhatsApp and Facebook to keep in touch.He remembers his first night trying to sleep in the desert, when he heard a coyote howl. “I almost cried,” Mr. Parejas said.Now he is trying to help his nephew get an H-2A visa so he can also work for Mr. Stubbs. He said that he could probably earn as much if not more an hour in Peru, but that getting an employer back home to pay what he owes can be a trial. Working here delivers a dependable paycheck, he said.Mr. Rogers, too, appreciates the reliable paychecks and the fact that he has no expenses during the season and can bank his entire wage. He hopes to start paying down a large debt.Even so, he says that for him, the earnings are secondary. “Money isn’t everything, living is everything,” he said. “All you leave behind is your story, and this is a good story to tell my grandkids.” More