Magistrate tells offender to stop ‘wasting youth’