Decide what you are writing. Are you writing a future episode of a current sitcom television show? If you are, and you most likely are, you need to become familiar with the show. Read several episodes of the script. Get to know the characters voices, personalities and typical format of the show. Also, look over the master list of all episode loglines so you can make sure that whatever story you come up with hasn't already been done.
Develop your A story. Your A story is your main storyline and should involve at least one of the main characters. Then create a B storyline. Your B storyline is your secondary story that involves some of the other main characters or the supporting cast. A and B don't have to be about the same thing, in fact it's typically better when they are completely different and distant from one another.
Write out an outline. Make sure to stick with the already established structure and format. If the show has four acts write out your outline as four acts. Be sure to leave each act ending with a cliffhanger or extremely funny joke so that viewers won't change the channel during the commercials. Look over your outline. Is the A story the main plot and where most of the time is spent and action occurs? Does the B story easily intertwine? Is there an opportunity for weaving in hints of C story that can later become an A or B story in future episodes? Make changes as needed.
Open your screenwriting software. Make sure you open up a TV document. Start your pages off with the title of the episode and/or title of the show. Then type in the act. Begin you scenes below that. Make sure each act ends with a "end of act I" or "end of act IV" or "end of show" titling. This will prompt the next line to continue on a separate page and begin a new act.
Write you entire script. Read it over. Highlight every joke you hope the audience will laugh at. Have someone else read the lines. Ask for their opinion regarding their comedic value. Take notes on their comments. Give it to someone else to read and repeat the commentary questions and notes. Take all your notes and go back to make any changes. That's it! You just wrote a sitcom script!