In the US, unless you have that much cash lying around, you have to borrow the money from a bail bondsman. They typically charge 10% for loaning you the money, and they're out the dough if you skip bail.