This is so overlooked by most people! Good on you for realizing this. People should never "go on a diet". "Diet" is a definition for what a person consumes to sustain life, not a temporary thing to counteract poor habits.I don't try to be perfect (I know I will fail). I try to be good. The long run (lifestyle change) is how I approach it, not dieting.
If you eat crappy across the board, start making small course changes: cut back on soda consumption if you drink a lot, then cut it out completely. Cut back on desserts. A Dove chocolate can be a perfectly adequate "dessert". Reduce portion size. Think servings the size of a deck of cards for meat and maybe your fist for vegetables.
It is very hard, if not impossible, to go through life denying things that make you happy but if you make the small corrections over time you will discover that you enjoy eating healthy better than you do eating poorly. Then it won't take any discipline to not eat those things. You won't want to.