The bushido code is the code followed by the samurai. It's an ancient moral code emphasizing self discipline, and honor. The word bushido means "Way of the Warrior" which is loosely translated to mean "Honor Until Death".
Under the bushido ideals, if a person failed to uphold his honor he could regain it by performing seppuku (ritual suicide). Seppuku is a deed of bravery that is admirable in a person who knows they are defeated, disgraced, or mortally wounded. It means they will end their days with their transgressions wiped away and their reputation not merely intact but actually enhanced.
Cutting the stomach is supposed to release the spirit in a most dramatic fashion, but it is an extremely painful and unpleasant way to die. Sometimes the person performing the act will ask a trusted friend to cut off his head at the moment of agony.