It is mandatory to be defended by a lawyer for a crime with a lower limit of imprisonment of more than 5 years. In other cases, it will always be beneficial to work with a lawyer in order to avoid loss of rights.