Make sure you have an idea before you start. It's no use sitting in front of a blank screen saying "right, it could be anything." "Anything" isn't a brief, it's a mental wilderness. You need to decide what you're going to write before you write it, and this is best done away from the winking cursor.
A sketch needs a premise, a core funny idea that is its reason to exist. As soon as a sketch begins, the audience looks for this premise and it needs to be apparent. Presenting a character? Make sure the funny thing about them is expressed early. Taking the piss out of some element of modern life? Present it at the beginning and quickly undermine it.
You need the element of surprise in comedy but, before that, you need to make people comfortable with where you are. There need to be, to quote the protesting philosophers from the Hitchhiker's Guide to the Galaxy, "rigidly defined areas of doubt and uncertainty". So establish the setting first, make it clear why it's funny, throw in a surprise and get out. Ideally the last joke, or punchline, should be the best but the sad fact is there are more premises than punchlines. It's a great argument against intelligent design.
Sketch comedy doesn't benefit from the audience's loyalty to characters, it's only as funny as its last joke. But its advantage is that it can embrace any setting, subject or situation. Use these strengths by having lots of short and contrasting items. That way, if the audience doesn't like one sketch, you soon get the chance to win them over with something else.
· David Mitchell and Robert Webb are the creators of TV series That Mitchell and Webb Look.