Finished buds sit in a tray at a cannabis production facility in Fenwick, Ontario, Canada. (Galit Rodan/Bloomberg)

Robert Schwartz is a professor at the Dalla Lana School of Public Health at the University of Toronto.

On Wednesday, recreational cannabis will be legal in Canada. This dramatic shift in the law is cause for both cheer and fear. Will legalization exacerbate or alleviate cannabis harms? That depends. If the government seizes this moment to dissuade the public from smoking cannabis and to promote safer modes of consumption, then legalization doesn’t have to be negative.

In 2015, 10 percent of Canadian adults and 25 percent of people ages 15 to 24 reported using cannabis in the past year, according to a Canadian tobacco and drug survey. The vast majority smoked it, and 30 percent mixed it with tobacco. Cannabis smoke is similar in many ways to tobacco smoke: It contains 33 known carcinogens and regular use means people are at risk for respiratory disease, heart attacks and cancer. More than 30,000 Canadians receive treatment for cannabis-use disorders each year. It is estimated that some 4,400 traffic accident injuries and 75 deaths were caused by driving under the influence of cannabis in 2012.

Perhaps the most substantial societal cost of prohibition, though, has been the criminalization, marginalization and impoverishment of many thousands of people caught possessing and selling even small quantities of cannabis. With criminal records, these people struggle to find work and even to rent homes and often end up suffering from mental-health problems.

A big hope is that with legalization, illegal activity will be curtailed and the ills of criminal activity diminish. This alone could be a substantial public-health benefit. It will happen, though, only if legal marijuana is competitive on price, access, availability and quality.

A major fear is that legalization will exacerbate mental-health problems attributable to cannabis and that young people prone to psychosis may become dependent on cannabis. The government has a window of opportunity to educate the public, train health-care professionals and educators, and ensure responsible dispensing — something that was not done in the prohibition era.

What about smoking? Until now almost all consumption of marijuana has been by smoking. The fear is that if this trend continues, people will suffer from cancer, respiratory and cardiac disease. The act of smoking will become re-normalized, setting back years of tobacco-control gains.

One way to discourage smoking pot is to outlaw smoking in more public and private spaces. To be sure, safer modes of consumption are not without complications. Edibles are notorious for landing people in emergency rooms. Because the effects of eaten cannabis take time — even hours — and depend on what else one has eaten and on THC levels, naive users who are not properly warned can easily eat so much as to cause severe impairment.

For now, Canada is not legalizing the sale of edibles; the government may want to rethink this position. Many of these products are already circulating illegally without information and warnings labels. Product regulation and public education could help reduce the hazards of edibles.

Vaping, while almost certainly less harmful than smoking, is not benign. Eating or drinking cannabis is safer than vaping. All are safer than smoking. With the right public-health messaging, legalization may have the further public-health gain of moving current cannabis smokers to safer modes of consumption.

Compared with tobacco and alcohol, cannabis, when used responsibly, poses fewer risks to people’s health. Indeed, if responsible cannabis use replaces some alcohol use, it is likely that we will see a net public-health gain.

If the Canadian government holds public health as the primary value in legalizing cannabis, there is hope for a healthier future.