Microsoft just lets you create install media now.
https://www.microsoft.com/en-us/software-download/windows11
Like mentioned, if the machine was registered before you should be able to click that in a radio button during install and it should just work^TM^.
Edit: I see you mentioned 10 but I think same applies and the media tool is also available.