In general, there are two kinds of treatments: medications treatments and non-medication approaches, the most popular and most effective of which is called Cognitive Behavioral Therapy for insomnia (CBTi). Both approaches work for insomnia that isprimary, and insomnia that is co-morbid or co-occuring with other conditions such as depression, anxiety, chronic pain, fibromyalgia, and PTSD.
We treat insomnia in the context of PTSD with the standard forms of treatment though with a caveat: insomnia present with PTSD is unique, so there are additional things we need to keep track of and address. In PTSD, it is often that case you have insomnia and nigthmares, so you must also include nightmare treatment.
For nightmares, their are additional behavioral strategies; the most widely used one is called Imagery Rehearsal Training (a.k.a rescripting therapy). In general, it views nightmares as a thought process that can be changed. Folks write out their particular nightmare or recurrent nightmare, rehearse it, either by reading it out loud or to themselves, then change something about the plot or description. What happens is that after enough daytime practice with this approach, the nightmare will change.