Each topic in your project can have its own list of "index keywords", each of which will create an index entry in your output. You can add both simple keywords (master keywords) and keywords with sub-entries (child keywords). Only one level of child keywords is supported (this is a restriction imposed by the output formats, not by Help+Manual).
Index generation is automatic. An index will be generated when you publish as soon as you have added one or more keywords to any topic in your project. However, in WebHelp you need to activate the index in the output in your Navigation settings if you want to include it.
It is best not to use keywords in popup topics and topics without TOC entries. Clicking on Keyword Index entries will display these topics in the main help viewer and this may confuse the user.
IDs, Context Numbers and Keywords (Reference)