NOTE: This spoiler was submitted by Jeremy.
The film starts with James King (Will Ferrell) crying hysterically. One month earlier, James was an extremely wealthy hedge fund manager, engaged to his gorgeous gold-digging fiancee Alissa (Alison Brie). His car washer, Darnell Lewis (Kevin Hart) is a married to Rita (Edwina Findley Dickerson) and trying to put their daughter Makayla (Ariana Neal) in a better school away from the bad neighborhood they live in.
James meets Darnell when the latter accidentally frightens James in the parking lot because he assumed Darnell was going to rob him, when he just wanted to give him his keys. James makes a speech about how he got to his success, and to inspire Darnell to go for his. He pulls out a big wad of cash, only to pull out two singles as a "tip" for Darnell.
Alissa hosts an engagement party for herself and James. She gives him an electric guitar as a gift, and she invites John Mayer up onstage to perform. James performs alongside Mayer momentarily until the cops storm in and arrest James for fraud and embezzlement.
James's lawyer Peter Penny (Greg Germann) urges James to go for a guilty plea, but he refuses and insists that he will be exonerated. Instead, everybody that lost money in the embezzlement scheme is out for James's head. The judge finds him guilty and sentences James to ten years at San Quentin, with only 30 days to get his affairs in order. His assets are frozen and he is placed under house arrest. He cuts off the ankle bracelet and tries to flee the country. He drives to a country club to get Alissa to go with him, but she says she has left him and decided to move on. The police then show up and get James. James asks his boss and Alissa's father Martin (Craig T. Nelson) for help.
James encounters Darnell once more in the parking lot, expressing his fears over going to prison. He asks Darnell how he managed in prison, simply assuming he was incarcerated because he is black. An outraged Darnell reminds James that he will most likely be made somebody's bitch once he gets to prison. With that in mind, James begs Darnell to teach him how to toughen up if he wants to survive in prison. Darnell demands payment in the form of $30,000. James agrees to this.
Darnell, who has little idea of how to act tough himself (he gets smacked after calling Rita a bitch), tries to put on a facade of his own to convince James that he can show him how to prepare himself. He calls up his cousin that did go to prison and asks him what went down. To start his "training", Darnell pepper-sprays James upon arriving to his home. He tries to get James to become intimidating with his "mad dog" face, but James can only "sad dog" it.
Darnell tests James in fighting back by creating scenarios in which he must defend himself. He makes James pick fights at the park, only for James to get his ass kicked multiple times. James gets in touch with Martin and says he's getting help. Martin, who is the actual crook, thinks James is onto him and orders his lawyer and a hired gun named Gayle (Paul Ben-Victor) to take care of business.
With little time left and even less improvement, Darnell figures that James has to learn how to perform oral sex in prison. They go to a gay hook-up spot for James to find a man to suck off. He can't go through with it and tells Darnell (in front of the other curious and interested gay men) that he will keep going and do whatever it takes to get hard. They leave as the men applaud them.
James starts to work out harder and faster. He starts to make shivs just in case, and he keeps one in his anus just in case. Darnell simulates a prison raid with the help acting as inmates. In the chaos, James gets a shiv stuck in his head. Darnell drives James to his home for Rita to get the shiv out. He has dinner and listens to Darnell make up a story of how he went to prison (he just retells "Boyz N The Hood"). Rita asks Darnell why he can't just find the real criminal to help James.
Mere days before his incarceration, James and Darnell resolve for James to join a local gang, the Crenshaw Kings, to protect him in prison. James dresses in a ridiculous outfit that gets unwanted attention. Darnell's cousin Russell (T.I.) runs the gang and isn't convinced that James can pay him and knows that Darnell is lying about prison. James does help the gang gain interest in finance and stocks.
Darnell drives James to a bar where the Allegiance of Whites gang is. James is unable to be a convincing racist, leading the white supremacists to think he's a cop. They nearly burn his face with a motorcycle tire until Darnell rescues him by bursting in with a flamethrower.
Darnell realizes James is innocent and they conclude that Martin is the crook. They sneak into his home and find the embezzlement records on Martin's old computer. Unfortunately, Gayle finds them and takes the computer back after telling James that Darnell has a clean record and never actually went to prison. James feels betrayed and leaves the garage.
James returns to the Crenshaw Kings with the intention of joining. For his initiation, they want him to kill someone. Darnell arrives in time to stop him and convince him to catch Martin and expose him.
The two find Martin's yacht and sneak onboard. They grab the computer, only to come across Gayle and more hitmen. James unleashes a series of capoeira moves on the goons whole Darnell protects the computer. Martin comes out and confesses to the crime, while Alissa steps out and admits that she got in on the scheme. The guys try to get out on the life raft until Gayle shoots it out. James pulls out a gun he kept in his ass and aims it at Gayle until the cops show up just in time.
Martin, Gayle, and Peter Penny are all arrested. James is arrested for stupidly pulling out the concealed weapon, but he only serves six months. He helps the police return the stolen money and decides to give Darnell money to expand his car wash business. After the six months are up, Darnell goes to pick James up from prison.