For the more than one-third of Californians living under or near the federal poverty level, eviction may be the first step toward homelessness.

Several projects have been launched in California to help people at the turning point of eviction, trying to short-circuit the cycle of deepening poverty by preventing homelessness before it starts.

And there’s one relatively small step that may have a huge impact for people facing eviction—getting an eviction lawyer.

WhatMatters: Your daily guide to ​California policy & politics.

“It’s definitely cheaper to keep someone in their house or to get them in a house quickly than it is to deal with all the services that come out of living on the street,” said Tai Glenn, chief counsel for the nonprofit Inner City Law Center in Los Angeles. The law center offers free legal help for those facing eviction.

The 4,000 people a year helped by the law center, though, are just a fraction of the people who have been ordered to vacate their homes. More than 50,000 households get eviction notices every year in Los Angeles County—and statewide, according to advocates, that number jumps to 140,000 households.

In San Francisco, voters took an unprecedented step in June, passing a ballot measure to offer legal counsel to anyone facing eviction. That is expected to cost the city an additional $5.6 million a year, but advocates say it saves money by keeping people from homelessness.

In Los Angeles, county officials have taken a different approach with a pilot project called Solid Ground, which uses an innovative whatever-it-takes approach—that includes legal advice—and concentrates on one community at highest risk for eviction.

The need for legal advice for people facing eviction becomes clear outside a small office, down a long corridor at the labyrinthine Stanley Mosk Courthouse in downtown Los Angeles. A dozen people perched on benches outside Room 115 on a recent Friday morning, all waiting for that door to open. By 11 a.m., more than 30 people had already been seen there—each one of them about to be kicked out of their home.

One of the people who came to the courthouse was Terry Williams. He’s 71 years old and lives in South Central L.A. with his wife. Williams said his stomach dropped when he got the eviction notice. His wife has dementia, and they are living on a fixed income.

“It disturbed me a lot,” Williams said. “Yeah, I was really upset.” He didn’t know what he was going to do, until he talked to a free lawyer.

“When I found out they could help me, a load just left me,” Williams said. “I feel I got a chance. And that feels real good, when you got a chance.”

Lawyers don’t always stop evictions, but sometimes they can broker an agreement between landlord and tenant, or arrange payment plans, according to Glenn. But the biggest benefit for people is time. Tenants need some breathing room to find a new place, Glenn said, especially now, given the astronomically high price of rental housing.

“Nowadays, if someone gets evicted from their unit, the odds that they’ll find another unit they can afford in the same part of town or in the same county, really, is extremely rare,” Glenn said. “So people end up leaving their communities or becoming homeless.”

Williams said he probably would have left his home, even without another place to live, because he had an eviction order to follow. Getting a few more weeks or months to work out a new living situation made a huge difference, he said.

Many people who don’t get legal advice and find themselves evicted take interim measures, homeless advocates said, such as staying with friends or relatives for awhile. When that welcome wears thin, they tend to bounce from place to place, their jobs and family support start to unravel. They might try sleeping in their car, if they have one, and eventually can end up living on the street.

That’s why San Francisco voters recently passed Proposition F, which funds nonprofits to provide legal help for almost all tenants facing eviction. The cost of the measure depends on a number of factors, but the San Francisco controller pegged it between $4.2 and $5.6 million a year.

Charley Goss of the San Francisco Apartment Association says the city could spend those millions every year in better ways.

“They could provide homeless services, build affordable housing or do a number of things that could tackle the root cause,” Goss said, “which is that housing is not affordable in a lot of jurisdictions.”

Getting at the root cause of homelessness is a heavy lift. Even making sure renters know their rights and giving them some time to find a new place is quite a task in itself.

For the Solid Ground program, L.A. County analyzed what cities might be at higher risk for eviction, based on tenants’ incomes compared to rising rents and increasing property values. They also looked for places where the surrounding areas’ rent charges were similarly high—where it is more likely that, once evicted, people wouldn’t be able to relocate nearby, and might be at higher risk of homelessness. The number one city on the county’s list is Van Nuys in west LA, and this month county officials began the first outreach stages of their project.

The pilot doesn’t just advise people on their legal rights. It also plans to try some unexpected and innovative approaches, Glenn said.

“Let’s say you ended up at your sister’s house,” she said, “but you’re all sleeping on the floor because you don’t have furniture, and that’s particularly bugging her. If (the family members) felt like going and buying some bunk beds would keep you there and keep you off the streets, they will make that deal happen.”

Sometimes when people have been evicted, relatives or friends may be reluctant to take even a token amount of rent money, so lawyers can broker small payments for a period of time — drafting, say, a six-month contract. That could provide stability for the people who were recently evicted, and make the arrangement more agreeable and relaxed for the relative or friend who’s helping them.

Los Angeles and San Francisco officials hope their experiments will be picked up in other communities throughout California. If successful, renters like Terry Williams, who are just scraping by, won’t one day find themselves on the sidewalk with nowhere to go.

This story is part of The California Dream project, a statewide nonprofit media collaboration focused on issues of economic opportunity, quality-of-life, and the future of the California Dream. Partner organizations include CALmatters, Capital Public Radio, KPBS, KPCC, and KQED with support provided by the Corporation for Public Broadcasting and the James Irvine Foundation. Share your California dream. On Twitter, use the hashtag #CADream. Read More California Dream stories.