Most jokes follow a very basic formula: Setup + Punchline + Tagline. Pretty much all comedians, from the one-line yucksters of the Vaudeville days to the Louie CKs of our day, follow this simple formula. It's simple, un-flashy, but damn it works.
Setup: The thing you say before the audience is supposed to laugh.
Punchline: The funny part that gets the crowd laughing.
Tagline: This is another punchline delivered after the initial punchline. They're not always feasible, but as you watch more good comedy you'll see them in action.
Example: "Why did the chicken cross the road?" (setup) "To get to the other side." (punchline) "Then he got hit by a Buick." (tagline)
It gets more complex than this, with hooks, openers, closers, callbacks, etc. But for a beginner, this is enough to get you writing.