A man has been banned from driving for three years after being found guilty of drug driving.