Assuming a retail product key you can convert it (as long as it isn't a domain controller)
Dism /online /Set-Edition:ServerStandard /ProductKey:xxxxx-xxxxx-xxxxx-xxxxx-xxxxx /AcceptEula
--please don't forget to upvote
and Accept as answer
if the reply is helpful--