How do I properly place devices in an electrical enclosure?
Enclosure

You start with an enclosure that includes a backplate (interior panel) -- usually this is purchased separately from the enclosure itself, but the manufacturers make sizes that fit mounting holes in their enclosure.

Enclosures come in many sizes, different materials, different NEMA ratings, different cover options (screw-on/hinged, handles, locking), and with or without knockouts. Some have ventilation or even fans.



DIN Rail

All components get mounted to DIN rail. All industrial control stuff is available with DIN rail mounting options, including relay bases, fuse and terminal blocks, circuit breakers, and power supplies. 

 

Internal wiring

The internal wiring is all done with single-conductor wire, typically stranded copper, and color coded. Important bits are that Green = ground, and White = neutral. Beyond that, it's standard practice to make any unswitched hots black, but that's it. 

Above and/or below the DIN rail, you use Wire Duct to run cables. This comes in a few different heights/sizes, rigid and flexible. 



In many panels the wiring can quickly become confusing, so it's very good practice to label everything. This can be as simple as giving each wire a number and labelling both ends (typical), or as complex as text descriptions. You can use label printers designed for wiring, or buy number sets that stick/clip on. I used to be preferential to plastic number sets that clipped on, as they were easy to work with and modify.



Don't forget to ground the backplate and enclosure (there will be designated ground connectors on both).

Hook-up

You should provide a terminal block clearly labelled for external connections, near the point where the wires will enter. 

Wires should come in through approved connectors, which really depends on how it gets connected and the NEMA rating you're going for. This could be as simple as a box connector with NMD or BX wiring, or PVC or metal conduit, or flexible waterproof conduit (each option having its own appropriate connector type). Most panels don't include knockouts, so you use a punch knockout tool to create your own.

Tips


Start with a wiring diagram, and number all cables on this. 
Physically layout the components on the backplate, just to be sure ensure everything fits. Next cut your wire duct and lay it out, and finally, mark all holes that need to be drilled for DIN rail, wire duct and other components. 
1/2" self-tapping screws usually work well (remember, there is a space between backplate and back wall of the enclosure for screws). 
Assemble everything on the backplate before mounting it into the actual enclosure. 
Make sure all components you use are approved (eg, UL/CSA listed, or whatever is relevant for your jurisdiction)


Inspection

In most jurisdictions the panel will have to be inspected by whoever does your electrical safety inspections, and they'll typically put a sticker on it showing it's approved. I've only done this in Ontario, and in a couple cases have had the electricians doing on-site install specify that they won't install a panel unless it's got the approval sticker (which we were getting anyway). However I'm sure the specifics of this will vary by jurisdiction.



As Mike said, there are a ton of examples if you search the right keywords; hopefully this helps guide you to what the different components are. In any reasonably sized town you should be able to find trade stores for electrical contractors who stock most of this stuff.