It's not illegal to do drugs.
It's illegal to be in possession of drugs.
I know, I know. Use is proof of possession, but that's not really how people are prosecuted. However, if you get pulled over for DWI, there can be extra charges tacked on for possession.
I got arrested for public intoxication and underage possession of alcohol when I was 19. It took my brain quite a while to process the second charge. I wasn't in possession of alcohol at the time of the arrest. But they could still charge me because it was in my system.