For three years the priests would eat a special diet consisting only of nuts and seeds, while taking part in a regimen of rigorous physical activity that stripped them of their body fat. They then ate only bark and roots for another three years and began drinking a poisonous tea made from the sap of the Urushi tree, which contains Urushiol (same stuff that makes poison ivy), normally used to lacquer bowls. This caused vomiting and a rapid loss of bodily fluids. Finally, a self-mummifying monk would lock himself in a stone tomb barely larger than his body, where he would not move from the lotus position. His only connection to the outside world was an air tube and a bell. Each day he rang a bell to let those outside know that he was still alive. When the bell stopped ringing, the tube was removed and the tomb sealed.
As you can see, the process of self-mummification was a long and extremely painful process that required a mastery of self-control and denial of physical sensation. The self-made mummies of Japan are people who have earned the respect now shown to them, as they exemplify the teachings of the Shingon sect of Japanese Buddhism.
Not all monks who attempted self-mummification were successful, but the pay-off for the ones who succeeded was quite high. They were raised to the status of Budda, put on display, and tended to by their followers. The Japanese government outlawed Sokushunbutsu in the late 19th century, though the practice continued into the 20th. The practice of self-mummification, which is a form of suicide after all, had to be outlawed to prevent Buddhist priests from offing themselves this way.