First of all, congratulations on trying to make healthy eating choices. In the United States, the average person consumes way too many concentrated sweets, so trying to reduce that intake a bit is good for your overall health.
There are multiple strategies that can work for you here. One of these is to make sure that you eat regular small meals and snacks throughout the day. The idea is to prevent yourself from becoming too hungry at any one point in the day, because being hungry or eating irregular meals is what is most likely to trigger a craving.
When you do feel a craving coming on, be prepared. This might mean packing healthy alternatives. For example, you can carry an apple with you and immediately eat it when you feel the craving. Sugar free gum is another option that works for some people.
Also, remember that it is ok to have small amounts of sweets, just not all of the time. So, occasionally, you should reward yourself and have a small quantity of something you really like.
If you have more questions about controlling your sugar intake or about healthy eating in general, don't forget to mention them to your primary care doctor