If the police arrest you and the police charge you with a criminal offense, it is crucial you look at all defense options available to choose the most appropriate one. Sometimes that will be showing you did not do it. Other times it will be simpler to rely on technicalities.
The police can and often do, arrest people in the wrong way. If that was the case, you might be able to use it to persuade a judge to dismiss the charges you face.
The police cannot enter your home without permission
Let’s say you were sitting in your bedroom, listening to music, when the police smashed down your door and told you that you were under arrest. If the officers wanted to do that, they would have first needed to show a valid arrest warrant. They would have needed to get this from a judge after explaining why they needed it.
The police can only stop and search you for a reason
You are walking along the street, and the police stop you and handcuff you. You ask the officers why and they say that someone robbed the local store, and they know you have a previous conviction for robbery. A court should not consider that sufficient grounds to arrest you. If the store owner reported someone matching your description, that might give the police grounds to stop and search you for evidence. If they find any, it might justify them arresting you.
Legal knowledge is your best form of defense when accused of a crime. While the police should know the law, they can sometimes breach it. Challenging them might be the best way to free yourself from the charges you face.