Yoki starts out as a corrupt military officer squeezing the town of Youswell dry with outrageous taxes. When Edward and Alphonse show up, they con him into handing over the town and report his corruption to the brass—which gets him demoted and left broke and homeless on Central's outskirts. That's where he runs into Scar.
From there, the story splits. In the anime, Yoki tips off the military about Scar's whereabouts during a raid, only to get killed by Lust. In the manga, things go differently: Scar forces Yoki to work for him under threat of death. Yoki keeps trying to play it off like Scar is his servant, but he falls in line, calls him "master," and basically becomes Scar's reluctant tag-along as they travel.
Once he's following Scar around, Yoki pretty much becomes the comic relief. Fans often note he gets the short end of the stick—he takes beatings whenever he tries acting tough or superior to people. It's a pretty solid fall from grace.
Content compiled by AnimeList.moe from publicly available sources.