Make sure that you know which version of Windows 7 or Windows 8 you're currently using. (i.e. 'Home', 'Pro', etc). Find out the licence key for it. (You can do that by downloading, installing and running Belarc Advisor:
https://www.belarc.com/products_belarc_advisor )
Go to the Microsoft site and look for the download to upgrade from Windows 7/8 to Windows 10, ensuring that it's the
same version as the one you're currently using.
Install the upgrade. When you're asked for the licence key for Windows 10, use your old one for Windows 7 or 8. (It'll work just fine).
Job done - for free!