I was watching a movie and I saw Japanese goverment banned samurais when is that happened and why ?
I would recommend these answers
By /u/ryamano
https://old.reddit.com/r/AskHistorians/comments/9ct41z/the_last_samurai_samurais/e5e5blw/
I have a feeling that the film you are watching was The Last Samurai with Tom Cruise, and this answer by /u/AsiaExpert has good details on the historical context for that movie: