In Setting > Update & Security > Activation
Click Change Product Key
Then enter the new Windows 10 Pro product key
As soon as the computer is connected to the Internet, the Windows activation process
checks the hardware against Microsoft's servers.
If the hardware entitlement to Windows 10 Pro, it will be automatically activated, without the need to buy a new product key.