Don't eat junk. There's nothing to do if you already ate junk. Obviously you should avoid it in the future. If it's just a bad habit, stay conscious of what you eat, don't have junk food at hand (try healthy snacks instead), and have family/friends support you. If nervousness is the underlying problem, check the many healthtap answers about how to handle nervousness or anxiety.
Find out the ''why'' Either ''nervous overeating'' , a need for junk food --a way to not feel something you wish to avoid, and particularly a loss of appetite; each is sufficient reason for an expert psychiatric evaluation. The underlying reason(s) can run the gamut from strictly physical, e.g., diabetes, adrenal or thyroid diff. To purely psychiatric to a comb. Eliminate any bodily contribution;then ref. 2 a psych.