Tobacco is a good example. Legislation that you could not smoke inside or nearby buildings did a lot to curb usage.
What’s challenging now is that corporate interest in government seems to have increased rapidly. It’s unclear if legislation is viable.