Food can become lodged in your esophagus because your esophagus sphincter muscles do not relax and work properly.
That then leads to the food not passing through your esophagus to your stomach which can cause you to start choking, coughing and sometimes have difficulty breathing.
When food does not pass through your esophagus it's usually because the esophagus has contracted to where it cannot allow the food to move properly through it.
This can cause food to become stuck in the esophagus and make you cough and choke.
Your esophagus contains sphincters and sometimes those sphincters don't relax normally which prevents food from passing through the esophagus.
When someone has food stuck in their esophagus it can be an emergency if the person is having trouble breathing.
If the person is breathing properly and coughing then usually coughing hard enough can dislodge the food from the esophagus and the person will be fine.
It has happened to me and I just coughed hard for about a minute which seemed like days and eventually I coughed up the food and was not choking.
If the person is actually choking on the food in their esophagus then call 911 and start trying to dislodge the food by giving them the heimlich maneuver to dislodge the food.
But if the person is still able to cough and talk some and is breathing fine then there's not much to worry about.