Fun fact: no one really has a great answer to that question!
Different municipalities have different methods of investigating. There’s the traditional signs, like smell, but some places also use saliva tests. Most localities reserve the right to take blood and urine tests from drivers to test for drug impairment, but I’m not sure how often that happens with cannabis or how useful it is to measure contemporaneous exposure, considering how cannabis metabolizes. There’s been noise about breathalyzer tests for a while, but I’m not sure they’ve totally figured out how to do it reliably.
Basically, we’re not sure yet.