A lot of the 'issues' seen on these forums, are new users that jump into programming without 'reading the manual', and we see a lot of poorly constructed, unreliable or hard to maintain code.
In many cases, it's difficult to help these members, because their code is virtually unreadable by us - let alone the IDE/compiler!
Almost all the experienced devs in here want to help, but expect the OP's to also make an effort to help themselves.
Some concepts are hard to grasp until you've made a few mistakes, or played around a bit. Hardware development is a completely different 'kettle of fish'.
It's ok - and often desirable - to test your logic and code with simple 'sequential' logic to get it working, but that soon becomes massively overcomplicated or fussy when you try to debug or extend it.
Notwithstanding good style, which always helps - take look and see what you can learn about these elements...
- Scope of variables
- Arrays
- Pointers
- Data types
- Functions (and calling/return values)
- Conditional operations (Switch-Case-Default / If-ElseIf-Else / Do-Loop-While)
- Logical and Bitwise operators
You will often see the experienced coders say don't use 'blocking functions' or 'delay()' and use a 'State Machine' along with other unhelpful hints...
When you understand the relevance of above elements, the whole picture becomes a lot clearer to write complex, efficient and more reliable code - that is EASIER to diagnose!
Finally... if your code doesn't do what you expect, and you've used good style - you can comment out function calls or other elements in order to isolate the faulty logic... then work on the broken parts independently.
Added: For the most part, the 'standard' Arduino libraries are fine, and convenient for most basic development.
As your application settles in, or you need specific performance improvements - you may need to look at creating some code to replace or work-around the less efficient, but convenient library functions.
And don't for a moment, think that because you installed a third-party library - that it must be well written. It's just someone else's code hiding in a black box - for better or worse!
Added: Arduino experimenters that want to work 'outside the board' - using switches, buttons, sensors, servos, steppers, LEDs etc... should stop for a moment and learn the very basics of electricity (not necessarily electronics).
With that basic knowledge - about 80% of the 'why doesn't my switch work', or 'the LED comes on when it should go off' questions would not exist.
Understanding VIN, 12V, 5V, 3.3V, 0V/Ground/earth etc will help a long way to realising your software ideas - before you write any code. Then reading a bit about current (Amps and mA) - will possibly save you from releasing even more white smoke.