You probably won't need to place a lot of comments if you think carefully about how you name your functions and variables.
But with some complex functions, it can make your code more readable and easier to understand.
If you need to explain something, think about if you can make it clear by editing the code.
Think of variable names, function names
If it's complex and you can't really explain what's going on it could be worth it re-examine the code.
Keep it short and concise.
If it's not exactly clear why the code is there, you can explain your design choice right above the function someone else might see as redundant.
Including a reference to the source enables future readers to get the full context, such as:
what problem was being solved
who provided the code
why the solution is recommended
what commenters thought of it
whether it still works
how it can be improved
Links to standards and other documentation can help readers understand the problem your code is solving. While this information may be somewhere in a design document, a well-placed comment gives readers the pointer when and where it is most needed.
Comments should be added not just when initially writing code but also when modifying it, especially fixing bugs.
It can also be helpful to reference issue trackers:
Use TODO comments for any ideas for improvements, this will raise your overal Code Quality in the long run.