Formal language is language that one would use when speaking to someone of great importance or rank.
Examples:
The queen, president, or other world leader
You would not use slang while speaking or writing in formal language. Slang should only be used when speaking to close friends or family if you are speaking in a comfortable non-formal way. :)