Step 1: Capitalization.
The first word “how” must begin with a capital letter → “How.”
Step 2: Add question mark.
Since it is a question, place a “?” at the end of the quoted sentence.
Step 3: Add quotation marks.
Direct speech requires inverted commas.
Step 4: Conclusion.
Correct sentence: “How does this machine work?” asked the boy.