Reference book or websites on how Mac OS works
https://developer.apple.com has a lot of information, basic registration is free.
The books from http://newosxbook.com/index.php have more technical content than most macOS users/developers need in their lifetime.


Besides that you should be able find a lot of information by just googling for "macos launchd getting started" and similar search terms. For specific questions about problems in getting something done there is also always this site here :-)