The term tone refers to a writer's attitude towards the subject matter of a piece of writing or towards the audience for which the piece is written. Tone is especially conveyed through diction, which are word choices, but can also be conveyed through other literary devices and point of view.
When we speak of subject matter, we are referring to what is called the theme of a work. A theme is a universally applicable main idea found repeatedly in a work, an idea a reader can take away with him/her. For example, a major theme in Shakespeare's Romeo and Juliet is the dangers of uncontrolled emotions. The tone of a piece refers to the way in which a writer conveys the theme. Tone can express a wide range of attitudes and emotions; for example, "tone can be formal, informal, serious, comic, sarcastic, sad, and cheerful," among others.
The Literary Devices dictionary gives us the following example of a sentence expressing an informal and even frustrated tone:
I want to ask the authorities what is the big deal? Why do not they control the epidemic? It is eating up lives like a monster. ("Tone")
As we can see, the use of poorly punctuated syntax, the clause "what is the big deal," and a simile comparing the epidemic to a monster all serve to create a very informal tone; they also convey the writer's frustrated attitude.
The example above contrasts with the following example expressing a very formal, serious tone:
I want to draw the attention of the concerned authorities toward damage caused by an epidemic. If steps were not taken to curb it, it will further injure our community. ("Tone")
Here, phrases like "draw the attention" and "concerned authorities" convey the formal tone of the sentence.