What is the meaning of "prosecute" in this sentence?

Native speaker’s answer
Rebecca
The word "prosecute" here means to have legal consequences against you, like a fine, a citation, or being put in jail. In this case, he is referring to having to face legal consequences if he were caught with weed before it was legal. Ex: If you break the law, you will be prosecuted. Ex: Anyone caught trespassing on private property will be prosecuted.