I know I have insomnia because for over 20 years now I have a very difficult time getting any decent amount of sleep. Unless I just don't fall asleep on any given night, I usually get between 2 and 4 hours per night. After all these years I guess it's a certainty: I am an insomniac.
You can know that you have insomnia when you experience symptoms like having trouble falling asleep, waking up too early, feeling tired after waking up and having tension headaches. You should visit a doctor for a proper diagnosis if you have any of these symptoms.