it looks like you a new at this so, I'm going to try and translate the correct answer above as straightforward as possible.
when somebody signs in, you give them a $_SESSION variable that follows them all around the site with their "logged in" information stored. it looks like you have this figured out so far.
therefore, logically, if the $_SESSION variable is what tells the site that you are signed in, then removing the $_SESSION variable (or "session_destroy()" - ing the $_SESSION variable) will sign you out.
luckily, killing this variable is very easy, and can be done anywhere on a .php page. the method is as follows:
session_destroy();
yes. that is it. the whole enchilada. you just put that bad boy somewhere, and when php hits it, it will destroy whatever session your user had going - therefore "signing them out".
so, where do you put this? you put this anywhere you want php to log someone out. it could be at the top of your home page, it could be done when a form submits, it can even just be its own page altogether...which is the way I would suggest.
for example, as Rob stated above, you could create a page called logout.php. the user would somehow get to this page (via a hyperlink, or a form, or something), the php would do its trick, and then the php would transport them somewhere else once they are signed out. how would that look? check this out:
<?php
session_start(); // open the user's session on the page
session_destroy(); // kill the user's session
header("Location: somewhere.php"); // take the user somewhere else
?>
finally...there are tons of great resources about this. i recommend reading them (and btw, also resources on if statements from the look of your example) until your brain is numb and you dream about PHP.