Taking your dog to the vet is a good idea but it would not help when the dog is actually choking right before your eyes. If you know what to do you can save your pets life. In essence you need to act in the same way as when you see a child or adult choke on food.
A dogs mouth should be examined first. Take out his tongue and try to extract the food piece that is causing the obstruction.
It is necessary to perform the Heimlich maneuver if this is not possible:
Put your arms around your dogs body and stand behind him
You should make a fist with your right hand and push firmly forward just behind your rib cage
Continue this thrusting motion until the foreign object is dislodged from the dogs airways and he is breathing normally
Put one hand behind the dogs back for support and the other hand on the abdomen to support him while you move forward and up to dislodge the object stuck in his throat