My PC Screen Freezes Issues

I have a windows PC, and at times my screen freezes, and then a blue screen comes up saying that my pc has encountered a problem and after restarting everything works just fine. This has been going on a lot lately and I am concerned because my pc has a lot of important work. How can I solve it?

