Logout after form submit

I want a way to be able to log the user out once they submit a form and redirect to the login form. Also, an action button to log out and redirect to the login page.