You can download windows 10 directly from Microsoft. Download madia creation tool and run. You can either create a bootable pendrive or download iso and create a bootable DVD. With these you can then perform a clean install.
You can also upgrade you from 8.1 to Windows 10.
If Windows was installed once on your system and activated it will be automatically activated once reinstalled and connected to internet. The Microsoft servers will recognize your system and activate it as long as you install the same edtition as before (Home or Pro).