Sometimes people who suffer from insomnia or anxiety take different medicines together to create a more potent effect. However, these drugs can have dangerous interactions. Xanax and Ambien are two such prescription medicines that are prescribed for these conditions. Both medicines are central nervous system (CNS) depressants medicines and belong.