Thank you for posting in Microsoft Q&A forum.
If you are using SCCM, you can start from here to create a capture media:
https://learn.microsoft.com/en-us/mem/configmgr/osd/deploy-use/create-capture-media
Then create a task sequence to capture an OS:
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Add comment".