OK, first, the bank may not agree to just foreclose on you. Second, legally, the bank has to follow certain steps in order to foreclose, or it's not legal.
For your reference, a short sale of your home remains on your credit rating for 3 years. A foreclosure remains on your credit rating for 5-7 years. A deed in lieu of foreclosure (which is sounds like you really want to do) is also 5-7 years.
In order to "give the home back to the bank", you need to contact the lien holder (bank that holds the mortgage) and talk to them. Tell them you would like to give them the deed to the home in lieu of foreclosure. They will most likely ask for your financial data and your reason why you want to walk away from the home. If they determine that you are capable of paying the mortgage and just don't want to, they can come after you legally for the money that is owed.
I would HIGHLY recommend that you sit down with a HUD counselor and talk to them before you do anything. Call 877-422-9040 for FREE counseling before you do anything. They can do it in person, or over the phone. Taking the time to talk to the counselors can prevent a lot of grief for you later on.