Insert the structure of a term paper by numbering after the text has been written?

How do you number headings in Word after the entire body of text has been written? I can't manage to number the headings consecutively and appropriately, i.e. by 1., 1.1., 1.2, etc. And how do you indent the subsections in the table of contents?