jailbreaking my first iphone need help

Options
hello i have an iphone 3gs that i ordered off ebay for a cheap 30 smackers any how i want to jail break the phone so i can install some games that were removed from the app store but idk how to jail break it and i dont wanna brick my iphone so how do i go about jailbreaking it its the 16 gig 3gs not sure what ios version is on it