Jumping and structure help

Im making a copy off of a mario game and i need help making my character jump. Can anyone lead me in the direction for code or does anyone have a tutorial? Also, how can i make it so if the character runs into some structure, he cant just go right passed it? Thanks for the help