What are hookis

I have been looking around the wiki and google but I cant find a good explination of hooks in coding if someone can explain them to me in detail that would be nice.
also im really basic in lua I have started recently

Take a look here - http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexd101.html
From what I can tell it shows all the hooks that are important.

I have already i seen that what im wondering how do you know which to use and how to use them

If you have an idea of what you’re doing, look through the hooks and it will say Description: What it’s used for, for example

Hook.Add(“KeyPress”, “” … )
Description: Runs when a key has been pressed.

Ok so basicly when your coding you find hooks that would work for whatever your doing ( I only started coding recently with some help from friends)

Yeah, use hooks for certain events. They are a way to add onto what should be done to an event as opposed to overriding default GM functions. The “Think” hook will run every tick.

You “Hook” into a game event and add your callback.
When the event happens, the game loops through every added callback and calls them.

Some events will change if you return something, others don’t.