River of Misery-Buffering with Food

I need a little help on the “river of misery” I am treading in when it comes to buffering with food. I have a habit of eating/snacking off protocol at night and/or during the work day.
In the past, after I went into an unconscious snack fest, I would beat myself up and feel terrible about it (then wash, rinse, repeat). But I am trying something new and choosing curiosity and to be kind and forgiving to myself.
I’ve gone through the efforts of writing down exactly what I ate rather that just “binge off protocol.” I assume I need to get to the source of the emotion I am avoiding by eating, right? So looking back at yesterday-during the day I started snacking because I was avoiding going back into my office to do work. In the evening I was avoiding boredom and/or avoiding the effort it would require to go do something I find enjoyable (walk, yoga, stretching, reading painting, read to my kids). While snacking a little voice told me this wasn’t going to get me to my weight goal, but it wasn’t loud enough and the desire to snack and eat was more powerful . How do I tackle this reoccurring situation? Do I search/try to notice the feelings of avoiding work / evening boredom-relaxation time so I can address the emotions before the snack desire starts? What type of preventative thought work can I do so I set myself up for success in these moments? Thanks!