I think you mean late 19th century, Japan after westernization and opening its doors basically outlawed Samurai. They got rid of their old feudal system which meant Samurai were in a weird spot. The new government now an oligarchy has a standing Army made of peasants and lower classes mostly. They didn’t need the Samurai anymore or their large cost of maintaining them. Samurai for many years were free from taxation and given stipend by the government. Now that was costing them too much and cut them from the expenditure.
While some rebelled and try to resist the change of the government like Saigo Takamori, many just became officers in the new army or higher ups in the new government. And I should mention Saigo Takamori while he did rebel against the government in the Satsuma Rebellion, he advocated for a lot of change in the army and westernization. He just thought it was going too fast and Japan would lose itself from government corruption or western powers.
Most Samurai accepted the change of losing their special privileges and grants. They now could have mobility in class be able to chose a new trade or lead this new army. While some did rebel and uprise against the government, the Imperial Army staffed and led by ex-Samurai would put them down.