Some of that is due to habits and lifestyles we develop, some due to insomnia. Experts disagree on how much sleep is enough for people, and it may vary, but there is no doubt that we cannot function at our best unless we do have enough sleep. It seems our bodies demand sleep, and the longer we try to postpone that, the more insistent our bodies become.
With a good diet, an eye on health and exercise, we ought to be able to sleep soundly. The Bible states that the sleep of a laboring man is sweet (Ecclesiastes 5:12). A tired body is a good start, but our mind also needs to be unburdened by cares. Family troubles, job or financial worries all leave us with difficulty sleeping soundly. A "cat-nap" is a great help when we are out of sorts, but developing good habits for bed time is vital. We have all experienced jet lag in travelling, and that shows how our bodies resist change. Take sleeping seriously. Get a little exercise, watch your health, and do what you can to get those 40 winks.