Some simple things that you shouldn't have to learn the hard way (but most people do):
Make sure your wiring contacts are electrochemically compatible. Gold-to-gold is safe in almost every household environment.
Strain relieve every wire. Solder is not meant to be structural.
Every circuit component degrades over time. Heat, humidity, and dust accelerates that process. Make a plan to mitigate the ingress of each, and a plan to account for that degradation.
Learn to design simple breakout-board carrier boards. The best breadboard layouts are still worse than a mediocre PCB, because the PCB doesn't have flywires to catch on literally everything.
Make sure you include mechanical support points for your designs, and pick the right size and material for your mechanical supports.
All of this to say, your hardware thing is a thing first, and an expression of your software/firmware design second. If it cannot physically survive being that physical thing, the elegance or resiliency of your code is meaningless.