There is a very short, very simple du’a that we can recite when in danger — whether it’s a threat from dangerous people, or even animals. That du’a is:
This was a du’a made by a young boy who was captured by the king’s soldiers. The king had ordered the soldiers to bring the boy to the top of a mountain, then force him to renounce his faith in Allah, or push him to his death if he refused. So the boy made the above du’a. The mountain began to shake until all the soldiers fell, but the boy survived.
The boy was again captured. This time, the king ordered his soldiers to take him to the middle of the sea in a boat, then force him to renounce his religion, or throw him into the ocean if he refused. So the boy made the above du’a. The boat turned upside down, and they all drowned, but the boy, again, survived.
So recite this du’a when you’re in danger, while having full faith that Allah will protect and save you.