Bored and Eating

When I’m watching tv I often eat when I’m bored. Like, “Oh, I need a snack. Something tasty.” Then after I have something salty I say  “I need to have something sweet.” But I’m seeing that none of this is tied to my hunger. How do I figure this out? Is this buffering? Why do I eat when I’m bored? How do I change this?