In my opinion, drug addiction shouldn't be viewed as a crime but a medical disorder as well as a societal disorder.
The method (assuming OP was addicted to it and by the way he explains this he isn't but assuming he is) should be to reflect on his life, identify what made him smoke weed, and society should take steps to keep that situation from happening whether it be a stuffty family life, a traumatic experience (abuse), etc. OP should then be checked into rehabilitation.
That's how addicts should be dealt with, not mindlessly thrown into prisons.