How to write a haiku

You can write haiku any which way you want, but its important to know the traditional form. That way you know how to break the rules. See the *notes at the bottom.
Traditional:

The art of "haiku" developed in Japan at the beginning of the seventeenth century, a descendant of the "renga," a regal poetic form of verse with Chinese roots. It was the most popular form of Japanese poetry during the Edo Period, which spanned roughly from 1600 to 1868. A poet named Matsuo Basho was instrumental at the time the the dissemination of the haiku form. The Meiji Period, from 1868 to 1912, saw the haiku develop as a distincly Japanese form. This was largely due to the efforts of poet and teacher Masaoka Shiki, and his peaceful portrayals of rustic Japan.

The haiku contains a very simple format. It consists of three lines, one under the other, and syllables in gradations of 5, 7, and 5 in each line. It should be 17 syllables in all. The content of the haiku is to fill two parts, and for this reason the first or second line generally ends with a colon or semicolon. The haiku must contain a season word (kigo) to indicate the time in which it is written. (Example: spring, apple blossom, fall, leaves.) It is very important that the reader follow this seasonal rule, for a haiku without a seasonal reference is actually a "senryu." These tend to concern themselves with the human condition over planetary changes. Finally, haikus should always be untitled.

It is necessary to make sure that your haiku is technically and creatively sound to achieve the proper effect. Study on the haiku reveals that its translation into Western languages often creates confusion. The English syllable is longer than the Japanese syllable, and therefore what is appropriate in Japan may not translate well into Western speech. Some linguists argue that the seventeen syllables assigned to haiku in Western literature are too much. For a beginner, however, the seventeen-syllable rule is best.

The purpose of a haiku is the purpose of all poetry: to give the reader a new and uplifting experience of a typical situation. It is to be the essence of a spiritual experience. Masters of haiku (haijin) in Japan teach that juxtaposition of imagery is important. Ryhme should not exist, and typical poetic forms, such as alliteration and metaphor, should be avoided.

In order to create an uplifting haiku, buy a book or collection of haikus and get a feel for their form. Then find a quiet spot outdoors and sit, breathing deeply. Do not bring a pen and paper. The words that you finally settle upon will imprint themselves on your mind. Wait for something to inspire you. Do not look for this inspiration; it will come to you as you meditate. When you see or feel something profound, let your mind fit it into the patterns you have studied. The more accustomed your mind becomes to this patterning, the easier it will become to create the beautiful poetry.

In conclusion, the haiku of the famous poet, Matsuo Basho:

On a withered bough
A crow along is perching
Autumn evening now.

From: http://mnmn.essortment.com/haikuwritehow_rduy.htm

*Above are the strict and formal rules of writing haiku, but us westerners have bent and broken most of them. An example, I have seen great haikus written in only 5 and 7 syllables with no seasonal connection, like this one from Craigslist composed by a pair of dogs named Spock and Bones. It's genius:

bark bark bark bark bark
bark bark bark bark bark bark bark