In the Joomla backend, go to the Module Manager and open the module called "Articles Category". In there you can edit the parameter to suit your needs and this will display a tree structure of categories and the articles that belong to them.
If you want to display this module inside an article then give the module a custom position by typing one in, instead of selecting one. The in the article, add the following code:
{loadposition xxx}
Change xxx to the name if your custom position.