Benzodiazepines like diazepam are prescribed for short periods to ease symptoms of anxiety and difficulties sleeping. Diazepam works by affecting the way some chemicals in your brain (neurotransmitters) pass messages to certain brain cells. It has a calming effect on various functions of your brain.