Replacing static code in a template file with a sidebar and widgets?

To speak generally, you need to define a sidebar for your theme (sidebars contain widgets) and display that sidebar in your template.

  1. In your theme’s functions.php file, register a dynamic sidebar using register_sidebar()
  2. Create a sidebar.php file in your theme directory that calls dynamic_sidebar()
  3. Make sure your other template files (or header.php/footer.php if that is more appropriate) calls get_sidebar()

If you need some more specifics, please feel free to update this question or ask a new question. (Seeing code is good, we can provide feedback on code.)