For engineers and other tech workers, landing a job with one of the industry’s best-known companies was long the ultimate professional achievement.

Now, many Silicon Valley veterans are being driven to new paths far from the tech giants, prizing stability and personal values over prestige.

Laid-off tech workers are finding jobs with smaller and midsize firms, landing tech roles at nontech companies, and becoming freelance consultants. It is an unconventional mix, at least for a group of people used to having an abundance of choice working for names in tech.

But amid rescinded offers and ghost job postings as well as round after round of layoffs, the priorities of tech workers have shifted.

“The majority of folks that have been laid off from big tech companies, they’ve been disillusioned,” said Chris Rice, a partner with Riviera Partners, an executive-search firm that places leadership talent in software-engineering, product-management, and design positions.

It used to be that people could spend years of their careers at large tech companies without worrying about layoffs. That is no longer true, he said.

These days, because of the state of the job market, more people are pursuing tech jobs outside the tech industry or at startups that align with their passions, in fields such as green energy or artificial intelligence.

The percentage of tech workers who moved to nontech industries when changing jobs started rising late last year, after years of decline, according to an analysis of public online profiles by Revelio Labs Inc., a provider of workplace data.

The overall labor market remains strong, with the unemployment rate falling to 3.5% and employers adding 236,000 workers last month, the Labor Department said Friday. But there are signs of cooling. March’s job gains were the smallest in more than two years and less broad-based than they were earlier in the pandemic.

Recruiting senior candidates who have worked for tech’s biggest names into unknown companies is easier than it used to be if you can get them “over the mental hurdle of it not being on-brand,” Mr. Rice said. But candidates entertaining the idea of working for a small startup might need to brace themselves for a pay cut, he said.

John Kew, an engineer who lives in Seattle and worked at Tableau Software—which was acquired by Salesforce Inc. in 2019—left his job on his own in January, as Salesforce was going through a round of job cuts.

“I was looking at the people who got laid off, and it was just such a mess,” said Mr. Kew, 43. “A lot of the people who were laid off were high performers, people who I certainly respected and were doing amazing work.”

His move to an early-stage data-science startup involved taking a 20% pay cut, but Mr. Kew was ready to work somewhere smaller where he could learn something new every day and see his contributions in the product he was helping to build.

“As an engineer, I derive value from doing something useful,” he said. “In particular at a large company, it’s hard to feel that way.”

While some of the largest tech companies in the world—including Meta META -0.62%decrease; red down pointing triangle Plaforms Inc.’s Facebook, Alphabet Inc.’s GOOG -1.79%decrease; red down pointing triangle Google and Inc.—have announced layoffs, some parts of the industry are still growing. The unemployment rate for tech occupations is still low at 2.2%, which indicates tech employees are being reabsorbed back into the workforce, said Tim Herbert, chief research officer with the tech trade association CompTIA.

Technical services and software development, a subsector made up of mostly small and midsize firms, added the most tech workers in the past year, so workers seem to be transitioning from big tech companies to startups, cybersecurity, and technical consulting firms, Mr. Herbert said.

For years, there was fierce competition for tech talent, with companies wooing workers with generous compensation packages, in-office perks, and a suite of benefits, not to mention job stability. Especially during the pandemic, companies accelerated their hiring and invested in the idea that people would spend more time online for good.

Now, the same companies that contributed to enormous growth are touting the benefits of increasing productivity and becoming leaner. Mark Zuckerberg, chief executive of Facebook parent Meta, has dubbed 2023 “the year of efficiency” as he cut more than 20,000 jobs.

Startups are facing their own pressures, which are also affecting the investors who back the industry. Hiring in startups is a mixed picture, said Julia Pollak, chief economist with the job platform ZipRecruiter. Larger and later-stage startups that in a better economy would be scaling and preparing to go public are instead conserving cash and not bringing on new hires.

That said, there is still an appetite for talent at well-funded, early-stage companies in emerging areas, including electric-vehicle batteries, as the auto industry shifts away from gas-powered cars, and artificial intelligence, a technology with the potential to change industries that has prompted a global race to build AI products.

“There’s a gold rush to capitalize on those opportunities and be at the forefront,” Ms. Pollak said.

Financial-services firms and those in hospitality and logistics are now having better luck recruiting workers from big tech companies, said Allison Baum Gates, a general partner at the venture-capital firm SemperVirens, which invests in workforce technology companies.

“They couldn’t compete with tech companies on comp packages for tech employees because they didn’t have the same stock value. That was a huge problem for them,” she said. “Now they’re like, ‘This is wonderful, we can actually hire again.’”

Food and beverage maker Kraft Heinz Co. and global retailer Walmart Inc. say they are seeing a new mix of applicants from some of the largest tech companies, including Meta and Amazon.

“We’re likely looking a little brighter these days than we might have before,” said Donna Morris, chief people officer at Walmart, in an interview at The Wall Street Journal’s Jobs Summit.

Kraft previously struggled to recruit some digital talent, said Melissa Werneck, the company’s global chief people officer.

“Now, we’re seeing that they’re coming to us,” Ms. Werneck said of technology employees. “We’re seeing them knocking more on our doors.”

For some tech workers, the current market feels so volatile that they are choosing not to look for a full-time job. Fractional executive positions, which involve a person dedicating a few hours a week to multiple companies, are on the rise, and so are the number of people looking to consult or serve in an advisory capacity instead of in a full-time job.

“I have not applied for even one” permanent role, said Louis Moynihan, who was laid off from WhatsApp, owned by Facebook parent Meta, in November. “It’s not a good environment. Why would I put myself through that?”

Competing with thousands of other workers for positions he suspected might not actually get filled or getting a lowball offer didn’t appeal, so Mr. Moynihan has instead been leveraging his strategic partnership skills to help clients on a project basis at a rate of $300 an hour.

“It’s a cautionary tale for the titans because I do think amazing talent is being dispersed into smaller tech companies that eventually end up competing,” he said.