From the National Museum of Japanese History, the National Archives of Japan and MEXT.
From about the 10th to the 19th century, Japan had warriors and their families, arranged in ranks. Today we call them bushi or samurai.
Old writings use many words for them, such as 兵, 勇士, 武者, 武士 and 侍. These words did not always mean the same thing, and their use changed from one time to another.
The Imperial Court in Kyoto went on, but three warrior governments, called shogunates, were set up one after another: in Kamakura, in Muromachi and in Edo. Step by step, they took the real power of the country.
In the Kamakura period, the Court still ruled in name, but real power was held by the shogun’s government in Kamakura.
In 1603 Tokugawa Ieyasu was named Seii Taishogun (shogun), and the Edo shogunate began.
The samurai were fighters, but over time they also became the people who ran the government.
In the Edo period, the samurai were expected to learn both books and fighting. Schools called hanko (domain schools) were set up for them.
The samurai class came to an end in modern times, but it still had a great effect on Japan after that.
There is no single right answer. Talking it over with someone at home is a good way to learn.