Samurais were warriors of feudal japan
A samurai lives by serving his/ or her lord. Most samurai follow a code called bushido. A samurai's life should be a life without luxury, and their goal in life to commit to the tasks of their master with honor and respect. Also, their life and customs reflects two major philosophies Bushido and Zen Buddhism.
It means "a way of life." A samurai should not enjoy battles and must have compassion and respect for other samurai and lords. The sad goal of a samurai is to die in battle with one's honor intact. Bushido also covers how samurai should live their life and how they dress.
The seven virtues of bushido are loyalty, honor, courage, benevolence, rectitude, honesty, and respect.
If a samurai has dishonor himself/or herself or their master, a samurai must perform senpukku or hara kiri. (Japanese ritual for suicide) This will cleanse the stain of dihonor on their name, master's, and clan.
Examples of samurai who have not lost their honor:
A ronin is a samurai who has lost their masters or has lost their honor or has been exile by their clan/dojo. Ronin are like wandering samurai or renegades if they are like thugs working for the Yakuza bullying the innocent. They may also become freelancers, taking any mission (mostly assassination, protection or infiltration) as long as they pay is good. Most of time, ronin do not follow Bushido.
Examples of ronin: