Edwin Lopez was working at a tire shop when he lost his job in 2012. Next he lost his apartment, then his car.

He was getting some money to pay for food and a phone bill so potential employers could contact him But he was living on the street. He was homeless but hopeful.

>> Read more trending news

"I've never been a person to complain about my life," Lopez told the Sacramento Bee. "Even when I was homeless, I tried to look at positive things. I would say, 'I'm homeless, but I could be dead. I could be addicted to drugs or alcohol. I could get an infection from all the horrible living I'm going through, but I haven't. Other than (the fact that) I was starving, that was my blessing. That attitude is what got me out of it."

Lopez, who was serving in the California Army National Guard at that time, got back on his feet with help through the California Conservation Corps and recently was hired by the California Highway Patrol.

"(The vetting process) is an intrusive look at who you are, and everyone we talked to liked him," Joseph Farrow, CHP commissioner, told the Bee. "He had overcome so much with perseverance. He was trustworthy. Here is a guy who was homeless, and all he wants to do is to help people."

Like all new officers, Lopez, 26, is on a one-year probationary period. It’s a challenge he openly accepts.

"Whenever I doubt myself now I think, 'You used to eat garbage,' " he told the Bee. "There is not much worse you can go through."