Turning to food for comfort isn't inherently wrong, I think most people do it to some extent, so when you do this, try not to beat yourself up about it.
The first thing I would say is going to sound kind of simplistic, but you ask about avoiding comfort foods when you're tired. If you're tired, can you just, sleep? Like, even if it's still earlier than your normal bedtime, maybe your body really could use extra sleep. If it's a time of day where that's not practical, remember that food doesn't fix tired. Exercise might -- get up, walk around, get out in the sunshine if you can, stretch, breathe deeply. Do something that changes your focus for a few minutes.
Second, consider why you're tired, and work on fixing that -- did you stay up too late? Get up too early? Plan to get to bed at a time when you can get eight full hours of sleep, and stick to it. Are you working more than usual, or are under more stress, and that's causing you to feel more tired? If there are things you can do to reduce the stress or workload, do that.