If you purchased a retail license, you'll have a 25-character product key
Settings > System > Activation
Click "Change product key" and enter your key
For VLSC/KMS/MAK:
Obtain the key from your IT administrator or the Volume Licensing Service Center.
Make sure you have a legitimate license for Windows Server 2022 Datacenter. This typically comes through volume licensing agreements, OEM purchases, or retail channels.