I assume you are making a custom theme.
In your page files (index.php, post.php, page.php etc) you should create a div that will be the sidebar.
(Usually I use a php include (include("sidebar.php");
) so I only need the code once and when I edit the sidebar it applies to all pages.)
Inside the sidebar div input the code that you want.
e.g. a javascript script to have rotating images.
If you want to have widgets in your sidebar you need to create another file in your theme folder called functions.php.
In this functions file put this code:
<?php
if ( function_exists('register_sidebar') )
register_sidebar();
?>
Then, in your sidebar div put this code:
<ul>
<?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar() ) : else : ?>
<?php endif; ?>
</ul>
This will add widgets to your sidebar as chosen from the wp admin panel.
You will of course need to style the sidebar div accordingly to make it float left or right.