Open the terminal app, then open the preferences dialogue either through the menu (Terminal -> Preferences) or by pressing Command+,. Once the preferences dialogue opens, select the terminal style from the pane on the left, select Text from the button bar, than make sure the "Display ANSI colors" check box is checked.
That will enable the colors on the terminal. To get colors in the output on the terminal, you will need to embed ANSI color commands in the data being sent to the terminal. How this is done is dependent on the commands. For example (as was shown above) the ls
command has a colors option. For the color codes, do a google lookup for "ansi color".