Even though trazodone is not approved to treat insomnia, it is commonly prescribed for this use. It is generally effective and is often more affordable than other insomnia medications. However, since there are possible risks associated with the drug, talk to your healthcare provider about the benefits and risks of using trazodone for insomnia.