A canonical Q&A is, as BradleyDotNET puts it, "a broad question/answer pair that is intended to be a duplicate target for commonly asked questions", designed to avoid having duplication of Q&A. A beginner-oriented canonical covers an issue commonly experienced by people who are new to the language or technology discussed. An ideal beginner-oriented canonical will:
Meet all the site standards to avoid closure (except as a duplicate - but the other features below will inspire closure the other way around);
Have an easily searchable title;
Have a question that is impeccably well written and clear - giving a truly minimal MRE for "why" questions and a simple but exact specification for "how" questions, all using phrasing that is technically accurate, but still simple enough for the target audience to understand;
Have at least one high-quality answer that is comprehensive and well organized (bonus points for making it community wiki).
Here are some examples from the Python tag:
You can use a beginner-oriented canonical to close questions, regardless of the perceived skill of the OP, that are fundamentally about the same question or issue. To use it, select to vote to close the question, select "Duplicate" from the list of reasons, then select a beginner-oriented canonical that is actually specific to the question being asked.
When you find a question that seems like a good candidate as a beginner-oriented canonical, you may want to add it to your "Saves". The duplicate closure interface offers the full power of the site's search - which isn't very good in general; but this implies that the in:saves
operator can be used to narrow the search down to questions that you have previously identified as canonicals. This dramatically eases the process.
Closing questions accurately is an expected basic skill
A beginner-oriented canonical is a very powerful tool for keeping tags clean and shutting down reputation-seeking "fastest gun in the west" answers. Therefore, being able to (vote to) close questions as a duplicate, where appropriate, is considered a basic skill for any site curator. Similarly, voting to close is considered basic work you should do yourself before asking others for help (not applicable, of course, if you have a gold badge in the tag).
A beginner-oriented canonical isn't always the perfect solution, and shouldn't always be the go-to solution to dealing with bad questions. Questions should not be closed as a duplicate of a general "how to debug the code" canonical simply because OP has not attempted to debug the code. This is because, in nearly every case the question is not a duplicate; OP did not ask anything related to how to debug the code, but instead asked what is wrong with the code.
So, consider what is wrong with the code, and act accordingly:
If you can see the problem anyway and it is common, close as a duplicate of a canonical about the problem.
If you can see the problem anyway and it is idiosyncratic - i.e., something that other beginners could not be reasonably expected to do, but something that was clearly caused by OP not clearly thinking about the problem or not carefully typing - then vote to close as "not reproducible or caused by a typo".
If you can see the problem anyway and it is "easy" to solve, that is not a reason to close the question. Check for other reasons; if nothing else applies, leave it open.
If you can't see a problem directly, but you can tell that this is because the OP hasn't attempted debugging, then the question - obviously - "needs debugging details", and should be closed with that reason - not as a duplicate.
If the question appears to be taken from or motivated by homework, a contest, a job interview, a tutorial website etc., read How do I ask and answer homework questions? and act accordingly. Many but certainly not all of these questions should be closed as "needs more focus", because either there is a series of steps that OP needs to follow in order to solve the problem and the question needs to be about just one of them, or OP is showing way too much code for the question actually being asked.
If the question appears to be founded on a misconception, check whether that misconception is a) common and b) expressible in a clear manner while making correct and accurate use of terminology. If it isn't, then the question might be "not reproducible or caused by a typo", but in most cases it should be closed as "needs details or clarity". If it is, however, then a beginner-oriented canonical should be identified or created to cover that misconception.
When a beginner-oriented canonical can help you
By considering the question you can discover whether it asks about or directly relates to a common problem that beginners ask about - including things like:
basic logic errors that follow a specific common pattern (For this one, I included a specific language-agnostic example because I feel it's really necessary to understand the category)
how-to questions about common tasks (e.g. opening a file; parsing common data formats; making an HTTP connection to somewhere; splitting a string at word boundaries)
fundamental techniques (e.g. how to call a function, pass parameters to arguments, and use a return value; how to collect the results of iteration into some sort of data structure; how to split code across multiple files and have it work)
fundamental conceptual issues about how the language works (e.g. whether it supports pass-by-value and/or pass-by-reference function calling; whether variables have value semantics and/or reference semantics; whether the language has separate concepts of initialization/declaration vs. assignment; whether the language supports an indexed for-loop and/or a foreach loop that iterates over a sequence; whether libraries generally prefer to offer fluent interfaces or enforce command-query separation)
common gotchas ("undefined behaviour" in C and C++; issues with using mutable default arguments in Python; syntax errors caused by not understanding the rules for required braces or indentation)
This is almost certainly not an exhaustive list - the specifics of topics for canonicals will depend on the topics and, to a lesser degree, the userbase - but that fact should not be abused.
Properly closing questions can be very difficult. You might have to write your own canonical and answer it yourself, because nobody who actually has the question can properly express it. If there are already hundreds or even thousands of questions about a single, specific issue, it can become hard to find the best one (and there is no guarantee that any of them are adequate). The curators of a tag might therefore have to collaborate to identify the situation (perhaps using the site chat, for example like the room I created for Python canonicals), put together something authoritative, and close old questions by redirecting them to the new one, which is perfectly in accordance with policy.