The very short answer is: don't write at all unless you have to. The short answer is: in numerous different ways. A somewhat longer answer is: find the way that best suits you - that comes only from experience.
But, one might reasonably ask, what different methods are there which can be tried in order to get started? Well...
Don't Wait For Inspiration But don't take that as an absolute which suggests that one should not be inspired at all. Of course, we all want inspiration. Yet if we wait to be inspired for the whole poem, most of us will have taken the very short answer given above and we shall write very little and very infrequently.
You probably know the old adage about any form of art being ten percent inspiration and ninety percent perspiration. It's mostly like that with poetry. The very short answer above is saying: write only when you feel moved to write and have something urgent to communicate. But don't expect the inspiration to carry you through the whole poem. On some occasions it will but, at least in my experience, that will not happen all that often.
Inspiration can come in various ways. At one end it can come as a complete poem; at the other, it comes simply as an idea, a concept or a way of looking at something. Then the poem has to be built around that in some way.
How To Build A Poem
This is getting to the nitty gritty of the question. The answer to How do I build or write a poem depends to some extent on what you are starting with. Suppose you have just had an idea, a concept, a way of looking at something. One might, for example, have a sudden flash of inspiration that a person's life could be summarised by the array of cups they have in the kitchen. Okay, how might one approach the development of that?
First is to have some idea of the probable length of the poem. The cups/life idea might be interesting but it's not going to stretch to the length of "The Rhyme of the Ancient Mariner" It's going to be quite a short poem. In fact, with an idea of this kind short becomes very important. Trying to stretch it out will probably result in loosing any potential for impact.
So one is thinking of a few lines, and probably quite short ones. Next is the syllabic or the rhythmic structure of the lines. A great deal can be said about these aspects and so we can say very little in this short article. The way the lines are constructed should be contributing to the overall impact or impression made by the poem. Lines may have the same number of syllables, or some lines may be long and other short. Verses, like lines may be all of the same or of differing lengths. These aspects may be part of a deliberate overall scheme, or they may be due to the way you feel the poem should evolve. Experience will usually contribute to the development of these kinds of instincts.
The poem may also be one without thyme, or with rhyme at the end of each line, or with rhyming lines alternating or rhyming every third line and so forth. Alternatively, the lines may have internal rhyming in that two words rhyme within the same line.
Consider the following poem as an example.
Used to buy the cups in tied sets
batched identical or matching.
But that's a now flawed memory
and for a long time we rhymed them
into pairs, merging his and hers,
protocol of shape and colour.
Now I buy only one-by-one,
each detached and unmatchable,
self-chosen oddments on a shelf
Note that: there are eight syllables in each of nine lines. There are no end rhymes but each line has an internal rhyme, though some are less obvious than others. In the first line "buy" and "tie" in tied" rhyme. Due to the "d" in tied" the echo of the rhyme is subdued or more subtle than otherwise. (Note also that there are different kinds of syllables, which we do not have space to discuss here)
Compare this poem with an alternative approach, albeit little different in length:
On the mug-stand (a)
handles once hung (b)
cups of pristine sameness (c)
beautiful and aimless (c)
in the song they sung (b)
at secondhand. (a)
Mugs are still hung (d)
but different (e)
shapes and colours, chipped, cracked - (f)
and spaces from the fact (f)
of life. Refluent (e)
the song now sung. (d)
Now "The Mug Stand" has a much more complicated structure. There is no internal rhyming but the end-rhymes are arranged to give sometimes stronger, sometimes more subtle echoes. The letters at the end of the lines (a, b, etc.) indicate those which rhyme with each other. The pattern is the same in each verse so that, for example, the first and last lines in both are seen to rhyme.
Notice also that the syllabic length of lines vary within each verse but have the same pattern for each verse (i.e. 4,4,6,6,5,4,). The end of any line should not be chosen in an arbitrary way, but should add something to the overall effect.
Discipline In Writing
Every poem you write should have its own form of discipline. Some people think that so-called free verse is easy to write and that one can do anything in such a poem. All this is untrue.These are ideas that contribute to a lot of bad verse.Good free verse is in many ways the most difficult to write, precisely because there is no obvious discipline enjoined on the writer by which the poem might be made to work. Yet somehow it does have to create a desired effect. Writing to a defininte pattern or rule imposes a discipline which, with some practice, will initially help one to produce rather better verse.
If you are just starting out to write poetry, do begin with rhymed verse. But try not to make the rhymes too heavy and obvious. Look for different words to create an effect rather than use the first that come to mind. Try an abab or abcabc type of structure rather than aabb.
Make every effort to avoid cliches. Using them is so easy a trap to fall into simply because they are phrases we have heard so often that they just creep or spring into our mind. A good poem has to have some degree of originality. Cliches are as irratating as fleas on a dog. Combe through the poem to discover any cliches - looking for phrases like Combe through! Are there any more in this paragraph?
When the poem is finished, it is good practice to put it away for some weeks. Then take it out and re-read it. Be severe with yourself! Remove anything which is not right (cliches, repeats of the same word, clumsy phrasing etc.) and re-work the poem until you feel you can do no better.
Then submit it to some publication which uses poetry. There is little point in writing poetry purely for oneself. Don't be put off by rejections. Some editors may offer suggestions for improvement. Accept them if they seem valid. But keep submitting. Not every one will like what you have written. But you must like it.