What it is actually for
The editor is deciding one thing: is this paper worth sending to reviewers? The cover letter is your chance to answer that question in their language rather than making them extract it from the abstract.
That means it is not a summary of the paper. The abstract already does that, and repeating it wastes the only space you have. The letter should say what the paper contributes, why that matters to this journal's readers, and why you are sending it here specifically.
The last point is the one most letters omit and the one editors notice. Referring to work the journal has published, and explaining how yours relates to it, demonstrates you have read the journal rather than picked it from a list.
Do not summarise the paper — the abstract does that. Say what it contributes and why it belongs in this journal.
A structure that works
Open with the title, the article type, and the fact you are submitting it for consideration. One sentence.
Then two or three sentences on the contribution: the problem, what you did, and what changed as a result. Written for a specialist editor who is not necessarily in your exact subfield.
Then one or two sentences on fit — why this journal, referring to its scope or to specific work it has published.
Then the declarations the journal requires: that the work is original, not under consideration elsewhere, that all authors approved the submission, and any conflicts of interest. Many journals specify exactly what must be stated, so check the guidelines rather than guessing.
Close by offering suggested or opposed reviewers if the journal invites them, and sign off. One page is plenty.
What to leave out
Do not claim significance you cannot support. "This groundbreaking study revolutionises the field" reads as a warning sign to an experienced editor. Let the contribution speak in specifics.
Do not mention that the paper was rejected elsewhere unless the journal asks, and never explain how urgently you need it published — for a degree, a visa, a promotion. It cannot help and it puts the editor in an awkward position.
And do not reuse a letter written for another journal. An editor who spots a competitor's name, or a fit argument that does not describe their journal, has learned something about the care taken over the whole submission.