Can you use idioms in a composition? At your own risk. As Randy said, you could sound trite (ie. unoriginal), or you could even sound nonsensical if you use it wrongly. If you do use idioms, never paraphrase them.
Slang and idioms are two different things. Idioms are figurative expressions. Slang is just a localised expression. Avoid slang unless you know exactly who your readers are.
As you develop your English, you'll get used to slang and idioms, but be cautious. Don't bite off more than you can chew!