If you go this route, you’ll need to buy a license/activation key separately.
For the easiest possible OS installation, get it on a USB drive. You can buy ready-to-go Windows 10 and Windows 11 USBs that come with the required license, or – provided you have access to another computer – you can download the Windows 10 or Windows 11 installation tools and house them in a USB drive you already own, turning it into Windows installation media. If you go this route, you’ll need to buy a license/activation key separately.