The quickest and best way to get out of any sticky legal trouble is to post bail. Once bail is decided and paid, then you don't need have any more worries about the police, the judge, the jury, or anything else. In extreme cases, you go right out and do the same thing again, only to get caught and post another bail, walking away.
I.e., this is when fiction treats bail as a fine, not as a guarantee of a later appearance before the police or the legal system. In real life, most courts take a very dim view of people abusing bail, or failing to appear later—if the legal system even has a system for paying bail. (Hint: most countries don't.)
This could be generously seen as an example of Conservation of Detail: somewhere between episodes, the character goes to court and gets a small fine or some other inconsequential outcome, but this isn't interesting enough to bother showing. But usually it's a bad case of Artistic License - Law.
Zigzagged in the Lucky Luke album Belle Starr. The titular character goes around posting bail for various criminals in exchange for working for her. Since she's bought off the local judge, his brother (who runs the only long-distance communication service) and the priest, she can continue unhindered.
Used a few times in the Midnight Run sequels, where Jack gets in trouble with local law enforcement and then posts bail. Egregious because the main character's job is to hunt down bail jumpers and bring them back to Los Angeles for prosecution, so they really should know better.
Averted in the remake of Shaft, which is surprising considering how fast and loose they are with the law in the rest of the movie. When Christian Bale's character jumps (no pun intended) bail by flying to Switzerland, he is immediately arrested the moment he steps foot back on American soil. Of course, he ends up getting released on bail by the judge again (highly unlikely in Real Life, given that he's proven himself a flight risk), making the whole exercise pointless, except as an example of what an entitled Jerkass the character is.
It's worse. His lawyer argues that taking away his passport is enough to eliminate him as a flight risk. The judge agrees... cue Bale's character calling Shaft from Switzerland to make fun of him. It's made blatantly clear that Bale's character's father is a very influential man, and the judge is making all the wrong calls either becaues he's in the father's pocket or someone higher up is.
In Elf, Buddy gets arrested and put in jail for fighting a mall Santa ("He's not Santa! He's a fake!"). His dad bails him out not long after, and Buddy is pretty much free after that. Pretty much.
Buddy: Things worked out great! They gave me a restraining order!
Justified, averted, and lampshaded In A Civil Campaign. On Escobar, a bond is a guarantee of court appearance, but on Jackson's Whole bail means getting off into the clutches of the one who pays the bail.
"Whatever. The Escobaran Cortes does not, as you seem to think, engage itself in the slave trade. However it's done on this benighted planet, on Escobar a bond is a guarantee of court appearance, not some kind of human meat market transaction."
"It is where I come from," Mark muttered.
Somewhat invoked in The Art of Arrow Cutting by Stephen Dedman. Mage is up against murder charges, but Charles uses the power of the talisman to win enough money in Vegas to post bail. The evidence against Mage was fairly circumstantial to start with, and he manages to fake his own death before his trial comes up.
In Around the World in Eighty Days, Phileas Fogg and Passepartout are sentenced to imprisonment in India for desecrating an Indian temple. Phileas Fogg pays a bail for both Passepartout and himself, then immediately proceeds to board a steamer leaving for Singapore.
Used frequently in the original Knight Rider series, whenever Michael gets in trouble with the law the Foundation will bail him out. At one point a law enforcement officer who's trying to make trouble for Michael even explicitly invokes the idea that one day he'll get something to stick on him and no one will be able to bail him out (after already arresting him, Michael is currently out on bail for that charge).
Justified in the Miniseries Bonanno: A Godfather's Story. A young Joe Bonanno is arrested in Florida for entering the country illegally. A New York mobster comes down to bail him out and afterwards remarks that Bonanno will have to return for trial in a few weeks. He then breaks out into laughter because he was joking and Bonanno actually believed him for a moment. It's the 1920s and as long as Bonanno stays out of Florida, no one will come looking for him when he fails to appear for trial. The judge should have never granted bail to an illegal immigrant but the mobster bribed him ahead of time.
On My Name Is Earl, Earl feels compelled to help his ex-wife Joy make bail when she's charged with kidnapping and grand theft auto. The judge sets her bail at $1,000,000, which is more money than Earl has even with his lottery winnings, because this is her third strike. To get the money, Earl asks the richest (and craziest) man in Camden, Richard Chubby (Burt Reynolds), the owner of the local strip club and almost every other business in Camden. He agrees to give Earl the money, in exchange for bringing back his number one dancer, Catalina. Catalina agrees, until she finds out it's to help her worst enemy, so Joy steps up to dance...but disaster ensues after drinking to ease her stage fright, so Catalina gets on stage in order to help Earl out of the stress. However, the trope is subverted: Joy is expected to appear in court several episodes later, and spends the interim preparing for her trial.
This trope is downright abused in the episode where he helps his dad run for mayor. There is an entire montage of instances where Earl is bailed out of the local jail, with no lasting consequences. Forget Joy's three strikes; Earl should have had at least ten strikes by now.
Frasier. Discussed when Maris is refused bail because the police think she's a flight risk when she's arrested for murdering her lover.
Niles: Can you imagine?
Martin: Well, it didn't help that when they found her, she had a passport, a wig, and $10,000 in her purse.
Niles: Maris always has those things in her purse.
On Futurama, Bender's arrest for serial graffiti is forgotten about after he's bailed out.
In the South Park episode "The Losing Edge," Randy is constantly getting in fights at his son's little league games. After he's been released, Gerald asks him how much bail was and Randy casually replies, "Like two hundred dollars, no big whoop." This is played for comedy as he keeps on assaulting people over and over and presumably keeps getting let back out for chump change. The inevitable trial for twelve counts of assault never happens.
In the state of Georgia at least this is Truth in Television for minor traffic violations. In most states if you pay a fine before your court date, you sign a form confessing to the crime. In Georgia, however, the money you pay is simply your "bail." If you don't show up to the court date, its considered a no contest, and the judge will routinely sentence you to "forfeit bail."
Traffic tickets are generally considered a form of bail in most of the US. If you are issued a traffic citation for almost anything short of DUI, you are expected to either show up to court (and doing so is often a good idea, because in many cases the police officer won't show up and that often means you've won the case by forfeit, and even if they do, they are some of the easiest cases to win, especially in regard to "fix-it tickets," where you can simply present proof that you fixed the taillight/had the smog inspection/etcetera) or simply pay the fine (which is admitting guilt and ending the case).
The practice of misdemeanor citation/"notice to appear" exists in some areas of the US (specifically where there is not enough room in jail for petty shoplifters or ticket scalpers or people with small amounts of drugs or disturbing the peace, for example, or where people who have committed such crimes are obviously not frequent offenders/not a danger to others/stable enough not to flee). In practice, this is similar to a traffic citation, except that you must appear in court, and that you may be later sentenced to jail but only if found guilty and a fine or diversion to treatment or the like isn't an option. In fact, if you are arrested for a petty crime, it is a very good idea to be polite and ask the officer if you can have a notice to appear rather than be taken to jail - some officers will do this, especially if you are polite and nonthreatening.
Similarly, "short arrest" is common for those who are of some financial means and stability and who have generally committed misdemeanors (e.g. first time DUI, simple assault, small amount drug possession). You will be arrested and booked, but you likely will not be actually placed in "general population"/a jail cell if your lawyer is present and pays the full bail amount. Of course you will have to show up to court and, again, you may end up in jail if found guilty and fine or diversion is not an option, but it will keep you free in the meantime (and, if you can show proof of innocence or of getting help if you do choose to plead guilt, time to build your defense/argue for a plea deal or lesser punishment.)