Currently I am trying to craft a fantasy story, but I am having trouble creating a realistic backstory that can explain character actions well. How can I fix that?
Backstory does not need to be either engaging or relevant. If it were both, it would be "story." Unless you have particular need to detail someone's backstory, don't. There are numerous examples of heroes, villains, and bystanders in literature who don't have a lick of precedent for why they are acting as they are.
JK Rowling is great in backstories. You check out hers to get an idea.
Once Upon A Time created a Rumpelstiltskin backstory; check it out too.
Me, I'm particularly gossipy and nosy. During that course of my everyday life when I hear one-line rumors, I arrive to conclusions that the person might be like this, like that. On news, when a headline was read, you'd jump to conclusions on the possible reasons why it happened.
I think that pretty well starts a good backstory. You think of a simple reason why the person turned to that type of him. Then, since it's fantasy, you'd do well in incorporating twists.
You need a clear sense of who your characters are. Their likes, passion, mannerisms, principles. With that, you could bind their backstory to the present story.