"Count sheep? OK, sure, that will surely cure my chronic, long term, debilitating insomnia. Thanks for nothing, knucklehead". That sentence is the normal, frustrated response from any insomniac when told this kind of lame advice. The truth is, if some of us actually resorted to this comically useless home remedy we'd have counted 640,000 sheep and still be at the task when the morning alarm sounded. As it applies to insomnia cures, counting sheep is about as useful as rubbing a cow belly for luck.
That said, there is the tiniest proportion of logic behind why people advise you to count sheep, the reasoning being that by busying the mind with a mundane and boring task, you free your mind from worrying over life's stresses. Since it is such a boring task, apparently counting sheep can also bring about a lull that induces the sleep cycles to begin. So all in all, as an impetus for better ideas, this ridiculous technique could be thought of as useful. Like I said, as an impetus for better ideas. In theory, sure, counting sheep should work. In practice? Absolutely not, at least not for someone with true insomnia problems.