The horrible realization that you don't matter isn't always moment of self pity. Sometimes it's you, understanding your place in the universe, and your insignificance when you compare yourself to the entirety of everything. It's a creeping realization that seventy or so years isn't really all that much, and that almost everything you experience, let alone everything you do, will be forgotten within the space of your lifetime. But, sometimes the only thing horrible about the realization is that it is inescapable.

It's like when you're sitting up late, listening to music, and you realize that in a hundred years, MAYBE two or three bands from your entire generation will be remembered. That doesn't make the music any less great. Or when you're reading a book, one that makes you sit up nights, thinking and wondering, and you realize that the only books written in your lifetime that anyone will still read in a hundred years are the books which are included in a school curriculum. That doesn't mean that the book's ideas aren't important. The relentless march of time renders nearly everything and everyone anonymous and forgettable when viewed over a long enough time line. But, you still have an identity and memories of your own. What about when you re-visit the first web page that you ever bookmarked, and get a 404 Not Found error? The Internet changes so rapidly that no human being can ever keep up with it all. But it's still vital, important, fun, and useful. In reality, realizing that you don't matter is nothing more than remembering that you are mortal.

This is why almost every faith discusses either an afterlife, reincarnation, or your inseperable oneness with the universe--because the species and the society need us to progress as though we (as individuals) matter to the whole. Being able to picture yourself as a continuing part of the universe on over indefinite time frame makes it easier to approach life with the solemn gravity required to do great things.

There's a step beyond realizing that you don't matter, though: accepting the fact that you don't matter, and moving on with your life. If you don't matter to anybody else, then the most important thing is to do the things that matter to you. Make yourself happy, make your friends and loved ones happy. None of us matter in the great scheme of the universe; everyone you know and care about are just a handful of lives that don't matter to anybody except you. Live your life like time is cheap, because time is cheap to everybody but you and those around you. Take time to do the things that you enjoy, to do the things that matter to you. Realizing that you don't matter to the species, planet, or universe is realizing that your time is to do with as you please.

Do what thou wilt shall be the whole of the law.

Update, from Fight Club's This Is Your Life:
You have to realize that someday you will die.
Until you know that, you are useless.