If it's a small amount, or if you are wealthy, you may simply post the entire cash amount of your bail. Assuming you show up for trial, you'll get your money back in full.
If you can't afford to post cash bail, you can work with a bail bondsman. A bondsman is in the business of making bets -- that you won't skip town while out on bail. Typically the bondsman charges a fee of 10% of the amount of your bail. Note that you don't get this money back. It's a fee for their service of guaranteeing 10 times that amount to the court.
For some reason, one agency, Leo's, seems to dominate the market among bail bondsmen. Apparently Leo aggressively seeks your business. Some say that Leo may negotiate a fee of less than 10%. Others say Leo will let you use your home as collateral. In any event, it seems that Leo may be your man.
If you're lucky, the court may release you on your own recognizance -- ROR -- which simply means your name is sufficient guarantee to satisfy the court.
Note that judges may set the bond ridiculously high as a way of keeping you in jail. I went from a $300 bail to $30,000 after a probation violation. The judge knew well that I was not suddenly 100 times more likely to skip town or cause harm to society -- the two reasons why bail exists. She was using a high bail to punish me. Hmmm, didn't the founding fathers write something into the Constitution about excessive bail?