That's not a question we can answer in a little text box - it's far, far too big a question, and requires a substantial amount of work. Indeed whole books on the subject exist!
This is the one you probably need to read:
Windows Internals Book - Windows Sysinternals | Microsoft Docs[
^] - but don't expect it to be a "couple of hours" to get through: you are looking at 1400~1500 pages of pretty technical stuff in two volumes!