Need clarification for "use this hook and some code" type of answers
TL;DR version: Most hooks_something() go inside your custom module's
  .module, but not always. You can put alter hooks in your theme's
  template.php file for D7 or in .theme in D8.


There are several assumptions packed into those answers, and yeah they can be hard for people getting used to Drupal. Here are some assumptions cooked into those answers.

First, they assume you know have the tools and knowledge to write code for your project. Often people give those kinds of answers when asked a question where someone was looking for a module that already does what they are asking. Some of that is the nature of the community, and some of that is the nature of sites like this one.

Second, they assume you have a module or theme for custom code already started (or know how to start one).  Lots of Drupal projects will have a module that is just there to provide a few needed hooks to handle an edge case.  

Third, they assume you know when to use a module vs a theme for adding the hook. Some hooks really need to be in a module, some should be in a module, and some should be in a theme. But in the end that's is often use case specific (or in the case of agencies done to be consistent with seven sites already supported by the same team).  Rarely do people give guidance which is the right choice.

Fourth, for some hooks they are assuming you know how to figure out how to get it called. Some Drupal 7 hooks (e.g. views) have a different pattern where you declare you have the hooks in your main .module file and then you define the hooks in their own file.

See also: Is it possible to define hook functions in template.php instead of the module?