Young children nearly always have tantrums out of frustration or because they are pitting their will against that of others.
Older children have tantrums because they can think of no other way of showing their determination. In the privacy of your own home, the best way to deal with a tantrum is simply to ignore it and leave the room.
It’s slightly more difficult, however, if you’re in public, but you can do several things. Don’t fuss, shout, or get flustered. Take your child calmly into a quiet place and try to calm her. If you are in a store, take her out into the street or to your car. In a restaurant, you might try the restroom.
Always take your child’s fears seriously and ask her to explain them if she can.