My friend was detained by the police. How can we get him out quickly?

Your friend was arrested by the Public Security Bureau. How can we get him out quickly? First of all, we should know what crime he committed, whether it was a civil case, a criminal case or a criminal case. If it is a civil case, you can spend a sum of money. If it is a criminal case, it needs complicated procedures. If it violates the regulations on public security punishment, it will be detained 15 days, fined and then released. You can also assume that you can bail him out, but you also need to spend part of your savings to bail him out.