A query letter is a formal way of introducing yourself and asking an editor or agent to see your work. Sometimes it is the only way for an author to reach out to an industry professional.
There are lots of great resources on how to write a query letter.
But are they always necessary? If an agent or editor has requested material, must you send a query letter?
Some agents and editors say that the answer is no. If you have had the opportunity to discuss your manuscript with an editor or agent for an extended period of time, and they have requested a full or partial manuscript, then generally a cover letter reminding them of who you are, where you met, and some key elements of your story are fine, along with any other requested materials, like a synopsis or outline.
The query is an introduction to an editor or agent. If you have met them in person and shared conversation, then chances are they will remember you if you send the requested material within a short period of time, then again, maybe they won't. The degree of formality you use depends a great deal on the individual and the relationships you build.
Some say not to send query letters at all. See the video below in which Michael Levin discusses how query letters are "invitations to rejections." He gives advice on what you should send instead.
Researching the editor and agent, asking questions, and getting to know them personally, will help you decide how best to present and sell your work.