1. Install the devel module and enable it.
2. Make sure that in your themes, page.tpl.php for example, you have the code as below:
<?php print $messages; ?>
3. Where you want to see the sub-variables of a variable ($vars here is an example), just use the code:
<?php dsm($vars);?>
Note: When in Drupal 6, just remember if you put it in phptemplate_preprocess_page it will show you the available variables for the page.tpl.php. Likewise if you put it in phptemplate_preprocess_node it will show you the available variables for node.tpl.php.