We can't tell you exactly how to do it, because we have no idea what mechanism you are using for login - much less what environment you are working in. If it is Web based, then login / logout is best handled by using Membership:
MSDN: Introduction to Membership[
^], and if you are using that you should already known how to log out, or it is explained in the documents.
If you are in Winforms, then you have presumably "brewed your own" login system, so we have no idea at all what help you need.