“You don’t want to go down the same path as your brother,” a judge has told a 30-year-old man who pleaded guilty to drug possession.