Hello,
First of all, I would recommend evaluating the viability or upgrade. Depending on the machine capabilities Windows 10 may be too heavy do not perform properly. You can check the requirements here: https://support.microsoft.com/en-us/windows/windows-10-system-requirements-6d4e9a79-66bf-7950-467c-795cf0386715
I would discard Windows 11, because most processors from those years are not compatible, but you can check the compatibility list:
About purchasing Windows 10, first you can install directly (recommended) by creating an Installation media from: https://www.microsoft.com/en-us/software-download/windows10%20
Then you can purchase a license key in: https://www.microsoft.com/en-us/windows/compare-windows-10-home-vs-pro
About Upgrading Windows 7 to Windows 10 there are couple of articles that cover mostly everything:
--If the reply is helpful, please Upvote and Accept as answer--