how to show post content with post name in sidebar?

This is a little broad and more than one approach is possible.

If you want to show posts in general sidebar area you would need to:

  1. Find and edit a template file responsible for that output in your theme
  2. Use WP_Query to query set of posts and output the results.

If you want to implement this in a sense of sidebar Widget (that can be controlled in admin to move it around and such) you would need to:

  1. Create a Widget, using Widget API.
  2. Again, use WP_Query for querying and output.

Given that your requirements are not that elaborate it might also be a good idea to look for existing plugins that offer post–listing widgets, they should be quite a few around.