My friend is in jail for burglary and to get him out, you have to pay 5,000 dollars. How do you say
to bail someone out in German? Can I say
Jmdn aus dem Gefängnis herausbringen or does it have to be idiomatic ?
The whole concept is a little bit different over here. If somebody is taken into pre-trial custody, there's usually a good reason for that. Sometimes a "Haftverschonung gegen Auflagen" is possible, but you're deep into lawyers' turf here.
"Put up bail, get out of jail" (for now) is nowhere near as automatic as in the US, where sometimes only the amount seems to be in question.
That said, "(die) Kaution stellen" would be an idiomatic expression.