When would informal language be used appropriately?

an article for a local newspaper.

a letter to a politician.

an essay on a test.

an email to a friend.

Informal language would be used appropriately in an email to a friend.