Will Minecraft delete after a factory reset?

My computer has been running super slow and I'm thinking of factory resetting it but I'm scared if I do that I will lose Minecraft Windows 10 Edition I do not want to pay $30 if I do factory reset my computer will it delete after I put back in my Microsoft account

If you do a full factory reset, anything that's NOT back up on an external storage device (USB storage drive, Cloud storage, ect.) will be lost. So you will lose all your files with Minecraft: Windows 10 Edition.

HOWEVER, the keys to Minecraft: Windows 10 Edition are connected to your Microsoft Account. Therefore, when you log back in to the Microsoft Store, you'll be able to re-download it at no extra charge (as you already purchased it). Just make sure you use the same Microsoft Account to avoid issues.

Yup. But you won't have to pay for it again.