Best thing you can do is read and study the scripts of good comedy films, take note of how the scenes are set up, the descriptions, the dialogue, and the structure.
Of course you also have to have a good sense of humor yourself. Do your friends find you funny, are people at parties amused by...