Find a way to guarantee that in ten thousand years your fossilized bones will be prodded at by lab-coat-wearing beings who are taller and have better teeth and prehensile tails.
There are all kinds of burial plans available to people. You can be buried in a plot, mummified in a mausoleum or cremated and shot into space. You can illicitly transforms your skull into a bong. There's even a service that places and maintains a webcam in the coffin and gives family and friends a website they can go to to watch things, ah, progress.
You can also donate your body to science, but only short-term science. A bunch of snotty medical students could play catch with your liver. Or you could head to a body farm, which lets you rest in ways many murder victims are found, and then uses the information gained from that to solve crimes.
What if you want to make a more long-term contribution, though? What if you don't want some 22-year-old student peering at you over the edge of a coffee mug, and instead want a currently negative nine-thousand-nine-hundred-and-seventy-eight-year-old student to do the same? How do you preserve yourself for science far into the future?
Well first, you find a buddy with a strong back and steady nerves, because fossilisation takes work, and old you won't be up for that kind of thing.
There are a lot of things that can technically be called fossilization. You can freeze yourself on an out-of-the-way glacier, although global warming could make that difficult. Or you can trust that the world will get over its Egyptology phase and dump yourself in a cave in the desert, where many mummies have been found. You could even spend your life growing a grove of trees and have your friend dump you in a massive vat of tree sap after you die. These methods keep you away from the many things that want to eat you effectively enough that your skin and hair can be preserved – opening up the possibility for clones of you to stumble around the future somewhere.
But is that really fossilisation? Doesn't a stone outline of you seem more classy and more mysterious?
For that you need moisture and sand. The flood plains of rivers, the bottom of the ocean, or deserts that are prone to flash floods need to be the places where you'll have your remains set to rest – so do leave enough money in your account for plane fare. You also need to be weighted down. Wherever you are, you need to hit bottom and stay there.
After that it's all luck.
First, the literal bottom-feeders need to pluck all the flesh off your bones. (No one said this process was dignified.) Then you need to be covered in sand, sand, and more sand. The more pressure on you, the better. Eventually the sand around you will be compressed to stone, but water will keep filtering through, and it will take with it dissolved minerals. These minerals will start eating away at your bones. As they do so, they'll leave a crust of minerals behind, in the shape of your skeleton. A couple of millennia, and some luck, and bam – you're a fossil. And your ghost can laugh stay on earth, wandering into shower stalls, freaking out people you don't like, and laughing at all of those space-ghost losers.