When you install windows you can enter the product key and the correct edition (Pro) should be installed based on the product key you enter.
If you have Pro edition installed now then the other user detailed post covers using the product key.
If it still doesn't work get ShowKeyPlus from the Store and enter the key at Check edition in the app. Does it verify a Windows 10/11 Pro licence.
Assuming the key is not VK7JG-NPHTM-C97JM-9MPGT-3V66T this is a generic key and cannot be used to activate windows.