Guys I have to ask....

Please i have to ask this so is it true for weight loss that until I'm in calorie deficit I can enjoy sweets or fast food? I just have immense craving for them sometimes and I don't know what can I do to stop that.