I helped my uncle build his house, the only thing he didn't do himself was dig the holes (foundation and well), pour the concrete, and tape the drywall. Everything was inspected by the county and passed. We could have done those as well, but is made sense to hire someone for those parts considering the experience/tools of family/friends, and how long it would take working only Saturdays.
I miss living where I have lots of family around. There are things I'm forced to hire out that I know how to do just because I can't make a few phone calls and get a dozen people to help next Saturday.
You can't just throw random trash together but there are simple "standard" ways of doing things with standard available wires and pipes and fittings and as long as you follow common practices you will be 95% of the way to a code compliant install. It is only when you want to do something in an unusual or shortcut way that you may run into real compliance problems.
Certainly don't try it if you are completely clueless, but reading a diy book or watching some diy instructional videos will get you pretty far and show you how standardized most residential construction is with hardware store materials.