If your diet consists of high calorie and low nutrient dense diet, it doesn't allow the body to get sufficient nutrition . It can also cause reduced metabolism, fluctuations in your
sugar levels which results in craving for certain foods . Also some of the processed food can be habit forming.
To avoid this, start having balanced and nutritious diet. Have frequent meals to avoid stuffing yourself with high calorie foods.
Try choosing healthy foods in place of unhealthy foods you crave for ,example whenever you crave for chips and crackers , you can substitute with crispy vegetables like carrot, green salad, sprouts etc. Again it doesn't mean you have to stop everything at once, gradually reduce the quantity of unhealthy foods by adding healthy substitutes with themin each serving. Once your diet becomes balanced and nutritious, your cravings will disappear and you can also lose some weight.