Typically the court system reffers you to a private drug treatment program for a certain amount of time which you pay for. Depends on your state and the judge.