Stay calm, and say less
Nothing useful is ever accomplished by arguing at the roadside or in a cell. Be polite, keep your hands visible, and do not resist, even if you believe the arrest is wrong. The place to challenge an arrest is a courtroom, with counsel, not the sidewalk.
You are generally required to identify yourself in certain situations, and you should. What you are not required to do is explain, justify, or give your side of the story. Almost everyone talks too much in the first hour; almost no one regrets saying less.
Ask to speak to a lawyer
On arrest or detention you have the right to be told why, and the right to speak to a lawyer without delay. Use it plainly: say that you wish to speak to a lawyer. Police must generally hold off on questioning until you have had a reasonable opportunity to get advice.
You do not need to have a lawyer's name memorized; free duty counsel exists precisely for this moment. Speak to counsel first, then decide what, if anything, to say.
Do not discuss your matter with anyone else
Phone calls from the station and conversations in cells are not private. Do not discuss the allegations with friends, family, or anyone sharing the space with you. Save the full story for your lawyer, where it is protected.
Bail usually comes quickly
Most people arrested are either released by police with conditions or brought before a court promptly for a bail hearing. Helpful things at that stage often include a stable address, a responsible person willing to assist, and clarity about work and family obligations.
Conditions of release are court orders. Breaching them is a new problem, sometimes a worse one, so make sure you understand every condition before you leave, and ask counsel about changing any condition you cannot realistically live with.
After release, the work starts
Write down everything you remember while it is fresh: times, places, names, what was said. Keep any documents you were given. Do not contact complainants or witnesses if conditions say not to, even through others.
Then get advice early. The period between release and the first court date is where good defences are built: disclosure requests, evidence preservation, and the first strategic decisions all begin here.