Hello

I am writing a short story and this is my first one. I need help with fresh crreative minds. The story has time loop. The protagonist is living the same day again and again like the movie groundhog day. The time loop happens from the beginning of the story and he is saving his family from a danger by solving a crime. But I can't figure out a reason why time loop happens here. So my question is: what are the possiblities to create time loop in a story.

Note: Once the protagonist understands the reason why time loop happens for him, his time loop ends.

Thanks