for good programming in general getting used to a good environment is the best advice i can give. personally, i use vim because of the vast amount of customization it has and how strong it can be at helping you code efficiently once you get the hang of it. the huge huge huge documentation on c and c++ will help you along the way and understanding what the docs are talking about will help you direct yourself when using weird niche libraries. other than that just practice practice practice and it will come to you eventually. try to understand pointers (who the fuck am i kidding, no one understands pointers) and memory allocation if you're wanting to focus on C.
other than that i have 10 general programming tips that ive learned over the course of a few years:
1. dont misuse assignment (=) with a test for equality (==)
2. using namespace std; is your friend for most simple programming. understand what it means, however.
3. only use global variables for communicating between functions
4. use local variables inside for loops
5. use ++ and --
6. learn to comment code as you go and also, time permitting, write pseudo-code
7. gets() is bad bad bad
8. git is your best friend. it's daunting at first but it's super simple to use
9. always write if statements with braces
10. INDENT