There are a few different ways you could go about doing this, but I'm only going to recommend the ways that I use.
The first is to ween yourself off of it. If you smoke several times a day, limit yourself to once a day for about a week. After that, start alternating and going every other day. Keep increasing the space between smoking until you only do it on Fridays/Weekends, and you'll be able to stop altogether pretty easily.
The way I typically favor is just stop entirely. It's incredibly difficult but once you get past that third/fourth day it gets way easier. Smoking will eventually become an afterthought and it won't be that difficult.
Lastly, as mikewill said, you really need to limit your triggers. If you do not have the strength to resist the peer pressure of people around you smoking, you're going to have to limit your time around those particular people.
Do NOT replace one habit with another. Don't pick up cigarrettes (if you haven't already), vaping (again, if you haven't already), and so on.
Remember that it's just a plant and it cannot control you. Whether or not you use is ultimately up to you, and there is not a doubt in my mind just about everyone is strong enough mentally to prevent themselves from smoking.
If none of this is working for you and you feel as though you have a serious issue/addiction that needs to be addressed, I would advise you to seek professional help. Addiction is not a subject to be taken lightly and your mental health is unbelievably important.