"Creating a product that works" may be the main goal. But it's about as helpful as "creating a piece of music that just rocks" is for an aspiring composer. The main question is "how do I create a product that works" - which is pretty much about skill.
Programming is such a wide field that you can't just pick a few "fundamental laws" to focus on. There may be 1000 or 10000 separate considerations, each of which is important in particular context, from particular point of view. The only way to learn the skill is to work, write code (this also includes making mistakes), read other peoples' code, read (often contradicting) opinions and ideas from books and web etc. Do that regularly for 10-20 years and you'll get good.
For instance, whether not to use a singleton is about making a trade-off between initial complexity (using statically referenced singletons is slightly simpler than carrying a reference around) vs. future malleability (you may find you've "painted yourself into a corner" later on). Some people are dogmatic about avoiding globals ("singletons are evil"), and even though it may be a good rule of thumb in general, globals and singletons do have their uses. For example, Java's System class is essentially a global singleton.