How to Write a Soliloquy
There aren’t really any rules for writing a soliloquy – simply let your characters speak their minds! Be aware, though, that the form of the soliloquy will tell the audience something about the character and their state of mind. So, an intelligent character in a calm moment will deliver a well-structured soliloquy that moves from one topic to the next in an orderly fashion. However, a more erratic character (or one experiencing extreme emotions) should deliver a much more disjointed and chaotic soliloquy.
When to Use Soliloquies
Soliloquies only appear in creative writing, and have no place in formal essays. Moreover, a soliloquy is generally a feature of a highly stylized kind of creative writing. Soliloquies are somewhat unrealistic – people generally don’t behave this way. So a soliloquy makes the whole piece seem somewhat less realistic, unless you use effective lampshading (see next section). In general, if you’re going for gritty realism it’s best to avoid soliloquies.
Soliloquies are much more common in visual media (theater, TV, film, video games, graphic novels, etc.) than in purely written media. This is for one simple reason: in writing, they aren’t needed. You can simply say, “Henry thought,” instead of “Henry said,” and get all the same information without having the character deliver an extended speech out loud. You might still use a surrogate soliloquy, though, if for example you want to show that a character is descending into loneliness and desperately seeking the companionship of inanimate objects.