You can use a dash to denote a sudden twist in thought or a deviation from a sentence's main point. In some cases, the interruption relates to the original idea. For example, "The boy---the one in the white shirt and blue jeans---is my cousin."
A dash can also be an informal alternative to a colon, which marks the beginning of a list. For example, "We need to buy groceries---milk, eggs, butter and flour."
The rules of dash usage vary depending on the writing format you are following. While writing a fiction story or a poem you might use dashes differently than you would when writing a newspaper article or academic essay. For example, Emily Dickinson, a famous poet, used dashes extensively.