Computer keeps crashing during Minecraft?

When i play minecraft after 10 min of playing my computer crashes and shuts down. How can i fix this?

Check the video card and CPU temperatures, there are free apps that monitor and read temperatures, do a google search. I recommend Speedfan.
High temperatures can cause systems to shut down. Check the CPU, case and video card fans (if you have a PCIe discrete video card) and make sure to remove any dust blocking the PC vents. If this is a laptop, make sure to place it on a flat surface and have proper ventilation around.

Another cause might be the power supply (applies to desktop PCs), although from the description a faulty power supply wouldn't cause a shutdown at specific periods. Power failures are usually more random and progressively worse over time.

If your PC overheats from Minecraft, you need a new PC.

Do you get any blue screen error codes or any other error messages? Or does it just freeze? May be worth checking your PC logs if that is the case for the error messages.

They are in Control Panel > Admin Tools > Event Viewer > Windows Logs. Post any error codes here.

Check your CPU/GPU temps using Realtemp, anything over 70c is pretty bad and you need a better cooler. If its cool then maybe your PSU is bad, or ram.