It isn’t rocket science. STOP putting the two – together.
You do not ALLOW the dog to get to your food! Let’s start with HOW:
Crate the dog, put it in a puppy pen, use a baby gate to wall it out of your area, or put it outside – when you eat. OR close the door to your room; eat standing up with a plate in your, hand or from the counter top (if dog has *NOT* figured out how to get UP there). ZERO training or hitting involved – just some different actions on your part.
Feel free to google = how to train or teach “leave it’ or the dog to do a “Down-stay”. Use moderately attractive but non-dangerous dog treats or dog toys – for said training, rather than YOUR cookies.