People are routinely and almost universally defended by lawyers in serious criminal cases in both civil law country and common law country legal systems. The availability of counsel for the indigent in cases involving petty crimes varies, but not in a way systemically related to the common law v. civil law distinction. It has more to do with the available supply of lawyers.
The lawyer's job isn't very different, despite the fact that the lawyer has an audience of a panel of judges rather than a judge presiding over a decision making jury, although obviously lots of fine details (e.g. concerning the procedures for presenting evidence) are different.
In both cases, defense lawyers call the attention to the facts favorable to the defendant's case, offer up evidence that tends to exonerate the defendant if the lawyer can obtain it, argues to the court regarding how the evidence should be interpreted and what inferences should be drawn from it, and argues regarding any ambiguities in how the law should be applied to these particular facts.
Furthermore, in most criminal cases, in both civil law countries and in common law countries, guilt or innocence is not the primary issue. The primary issue for criminal defense counsel in most cases is assisting the judges in determining the right sentencing option on the right charges for a defendant who pleads guilty or is found guilty at trial of some crime, based upon the character of the crime and offender that is presented to the court by the lawyer. This part of the process is very similar indeed in the two systems.
Typical issues might include an assault case where the issue is whether there was serious bodily injury, justifying a more serious sentence, or mere ordinary bodily injury, justifying only a less serious sentence, in a case where it isn't clear cut at the guilt and innocence phase, or arguing whether probation and a fine, or incarceration is a better fit to a minor offense, in the sentencing phase. It isn't entirely or primarily about "legal loopholes" in any system, although "legal loopholes" tend to be more important in U.S. criminal law than in many legal systems.
There are some places in which civil law courts are more open to consider a defendant's arguments than others (and many civil law countries decide serious criminal cases with a panel that is a mix of legally trained judges and lay jurors), but that can vary wildly from country to country and within a country as well.