Most of time I prefer to use 'prevent' rather then ' ward off" because I don't get those difference. Soryy I ask such a small thing. But my dictionary doesn't much explain it as I can understand.
Prevent and ward off are synonyms. Ward off, though, has a more literal meaning of physically deflecting something, such as raising one's arms to deflect a blow or a falling flowerpot. So, it's often used in a metaphorical sense to mean prevent. For example, you might perform some sort of prayer ritual to ward off ill fortune from your house and family, which would be the same thing as performing the ritual to prevent ill fortune from happening to your house or family. (Notice that with prevent I had to use a verb such as happening, whereas with ward off I did not.)
Another similar phrase is fend off, which has a more passive sense than ward off; a fender on a car fends off sticks and stones from the street, preventing them from being launched at passersby by flying tires. When you ward something off, you do something to deflect something. When you fend something off, you put something in a position to deflect something. So, for example, I might have put this paragraph in place to fend off comments that my answer was too short. That would be a metaphorical use of the term.