Prose craft
Soliloquy
A monologue in which a character speaks their thoughts aloud, typically while alone on stage, giving the audience direct access to their inner life.
A soliloquy is a monologue "in which a character speaks their thoughts aloud, typically while alone on stage or onscreen." The Latin roots are solus, "alone," and loqui, "to speak," and the word is recorded in English from the late sixteenth century. Its function is to give the audience "direct and unmediated access to a character's internal thoughts, emotions, and motivations," serving character development, exposition, dramatic irony and plot advancement. Hamlet's "To be, or not to be" and Macbeth's "Tomorrow, and tomorrow, and tomorrow" are the type cases.
The near neighbors differ by audience: a monologue is any extended speech by one character, listeners or not, while a soliloquy assumes no other character can hear. In prose the stage convention becomes a rendering problem: thought given directly, colored by who the narrator is. Spend it sparingly; a character who thinks aloud every chapter stops feeling alone.