There are healthy alternatives for many foods. I have seen a list of foods to eat when craving something (I do not remember the whole list.) Fortunately I do not crave unhealthy things often, I actually craved a salad today after I got home from the gym.
One thing you can do is buy healthy versions of the foods you crave (or don't buy them for the house at all.) Say you crave ice cream at night, try making a yogurt treat that is healthy and good.
I am not sure what you are craving or I may be able to suggest something as a healthy substitute.
Really if dangerous cravings are a problem, make sure you do not keep any of these things in the house. Even if other household members enjoy them, they are your family and if you tell them your concern I am sure they will agree not to have these things in the house.
Make sure you think about why you should not be having the food you are craving before you run out and buy it, that may help also.