Denethor hints at answers to both these questions when he says,
Better to burn sooner than late, for burn we must. Go back to your bonfire! And I? I will go now to my pyre. To my pyre! No tomb for Denethor and Faramir. No tomb! No long slow sleep of death embalmed. We will burn like heathen kings before ever a ship sailed hither from the West. The West has failed. Go back and burn!
(Lord of the Rings, Book V, Chapter 4, "The Siege of Gondor")
This indicates the following:
- There had been a pre-Numenorean tradition of laying dead rulers on a pyre and burning them.
- This tradition had been superseded after the Numenorean arrival by embalming and subsequent burial (entombment).
- Denethor is explicitly rejecting this Western tradition because Sauron has led him to believe that Western traditions have failed against the power of Sauron. To use modern terminology, he's suicidally depressed.
In addition to these two traditions (burning on a funeral pyre and entombment), Men also practice burial in a barrow (seen in the burial of Théoden, and in the barrow tombs of the North Downs, later occupied by Barrow-wights, but also in the burial of Elendil as related in Unfinished Tales).
Elves can also die, though this is relatively rare; we're never to my knowledge given a description of typical burial rites for individuals, though large groups of slain may be buried in a mass grave with a mound raised over it.
Dwarves, it seems, are typically buried "under stone", not under earth or in barrows. There is of course one famous exception: after the battle of Azanulbizar, there were many slain; but there was not enough stone or enough time to build proper tombs for them all. Thus (as Tolkien writes in Appendix B to The Lord of the Rings:
They stripped all their dead, so that Orcs should not come and win there a store of weapons and mail. It is said that every Dwarf that went from that battlefield was bowed under a heavy burden. Then they built many pyres and burned all the bodies of their kin. ... Such dealings with their dead seemed grievous to the Dwarves, for it was against their use; but to make such tombs as they were accustomed to build (since they will
lay their dead only in stone not in earth) would have taken many years. To fire therefore they turned, rather than leave their kin to beast or bird or carrion-orc. But those who fell in Azanulbizar were honored in memory, and to this day a Dwarf will say proudly of one of his sires: 'he was a burned Dwarf', and that is enough.