It will open in Microsoft Store, and give you the option to buy. Once you get the license, it will activate the Windows. Later once you sign in with Microsoft account, the key will be linked.
Microsoft has confirmed that users can no longer use old Windows 7, 8, and 8.1 ... to build a new PC or purchase one without an operating system, buying a Windows 11 key is now your only option ...