I've found caffeine to be the most difficult thing for me to kick, but weed is harder to give up than most people think. It's so much less debilitating than alcohol, so it's easy to live with. For me, the desire to get high drops off completely after about a week, so if you're a weekender like I was it can be difficult to shake, as you never get completely past the desire. In addition, smoking it, especially infused or more potent derivatives, gives way more of a dopamine hit than edibles, even if you ultimately get really high on edibles. Smoking it causes the drug to get into the bloodstream and hit the brain much more quickly, thus better connecting the act with the effect, making the dopamine hit bigger and the use more addictive.
If you want to quit, you need to cut out all THC for about two weeks or so, and then you don't really think about it anymore. Obviously, it will be more difficult if your friend group smokes weed, as you'll be around it, and it's best to avoid being around it when you're quitting. If you you're going to backslide, it's much better to do it with edibles, as they don't connect the act (eating) to the high nearly as well as smoking. Finally, as they say, "never quit quitting" and eventually you'll succeed.