How to do it
How to write a statement of purpose

The short answer
Work backwards from the claim. Decide the single argument the statement makes about you, assemble the evidence for it from your transcript, projects and work, write to the six-part structure inside the programme's word limit, then cut everything that does not support the claim. Most weak statements were written forwards as a life story and never made a claim at all.
What SOP writing means, and how to write an SOP in four steps
SOP writing means producing a statement of purpose: the one document in a graduate application where you argue, in your own words, why this applicant belongs in this programme. It is not a biography, not a covering letter and not a personal essay, and the three most common ways to write a bad one are to treat it as each of those in turn.
If you searched how to write SOP and landed among standard operating procedure results, that is the collision the abbreviation causes; only one of the two is an admissions document, and this is the one. So when people ask how to write an SOP, the honest first answer is that the writing is the last part. A statement fails on the claim it makes and the evidence under it, not on the prose, and a beautifully written document with nothing specific in it loses to a plain one that proves things. The four steps below are ordered accordingly: three of them happen before you draft.
Step 1: decide the claim before you write a sentence
A statement of purpose is an argument. Before drafting, write down in one sentence what you are asking the committee to believe: something like "this applicant has already done supervised work on distribution shift in medical imaging and is ready to do more of it here". That sentence never appears in the document, but everything in the document either supports it or is cut.
If you cannot write that sentence, the problem is not your writing. It is that you have not decided what you are applying for, and no amount of drafting will hide that from a reader who does this for a living.
Step 2: gather evidence, not adjectives
Go through your transcript, CV, projects and work history and list every concrete thing: a result, a dataset, a failure and what you did about it, a paper you read that changed your direction, a system you built. Each item should be checkable by someone who has your file in front of them.
Adjectives are not evidence. "Passionate about machine learning" is a claim with nothing under it; "our model dropped from 94 to 71 per cent on a second hospital's images, and the scanner metadata turned out to be doing the work" is the same claim with the evidence attached, and it is impossible to have written about anyone else.
Step 3: write to the six-part structure
The proportions matter as much as the content. For a 1,000-word statement: the opening problem takes about 10 per cent, academic preparation 25, research or professional experience 25, the fit paragraph 20, your direction after graduating 15, and the close 5.
Write the fit paragraph last and write it separately for every university. It is the section that decides whether the statement reads as written for this department or sent to twelve of them.
Step 4: cut to the limit
Treat the stated limit as hard. Some portals truncate mid-sentence and some committees stop reading; neither is recoverable. Cut the sentences that describe rather than argue, then the qualifiers, then anything a reader could get from your CV.
Read the result asking one question of every paragraph: what is this doing? If the answer is "establishing context" more than once, you have an introduction where an argument should be.
Related questions
How long does it take to write a good SOP?
Three to four substantive drafting rounds over two to three weeks is typical. The first draft establishes the argument, the second fixes the evidence and the proportions, and the third tightens to the word limit. Rounds compressed into one day tend to change words rather than structure, which is rarely where the problem is.
Should I write the introduction first?
No. Write the opening after the body, because until the evidence is on the page you do not know which specific moment introduces it best. Openings written first almost always begin with general statements about the importance of the field, which is the single most common pattern committees see.