Children particularly between the ages of about one and five, often put objects in their mouth. This is a normal part of how they explore the world. Some small objects, like marbles and beads, are just the right size to get stuck in a child's airway and cause choking. The best way to avoid this is to make sure small objects like these are out of your child's reach.
In most cases you, or someone else, will see your child swallow the object that causes the choking. However, there can be other reasons for coughing. If your child suddenly starts coughing, is not ill and often tries to put small objects in their mouth, then there is a good chance that they are choking.
If your child is still conscious but either they are not coughing or their coughing is not effective, use back blows (see how to resuscitate). If back blows don't relieve the choking, and your child is still conscious, give chest thrusts (see how to resuscitate) to infants under one year or abdominal thrusts to children over one year. Even if it is expelled, get medical help.