The solution is not stripping out html from an existing file but to build up your html files from different sources using a server sided script language like php.
With php you would have just one page (for example index.php) and include the content the user requests (like home, contact, guestbook, whatever).
The proper way would be to use a database for storing the information but this is far too difficult for begining with web development.
Save the html for the sidebar to a separate html file (sidebar.html). Rename your index.html to index.php.
Go to the location in index.php where your html code for the sidebar is and delete it and instead just insert this:
<?php include "sidebar.html"; ?>
This code includes your html file inside your index.php and your can reuse it on different pages by just including the same sidebar.html on every page where you need it.
The benefit is to be able to modify it in just one file if you need to make changes.
Now here is the disadvantage in this solution: You need php installed on the server your website will be hostet. Php is a program which interacts with the webserver and everytime a .php file is requested by a browser it will be handed over to php first for parsing the file and doing the includes, database access and many other cool things. So in order to use php-files and include html files within other html files you need php installed on your webserver. Also if you open your .html file by double clicking you won't be able to see the complete result unless you have a local webserver with php installed on your computer. That's all free software (apache2 and php) but for a beginner it's not so easy to install it. Maybe start with a prebuild package like xampp. (This contains the webserver and php with preconfigured settings to start quickly).
This topic is pretty basic for php so you will be able to find lots of tutorials on the internet about getting started with php. Good luck and have fun. ;)