Don Knotts played the very memorable character of Barney Fife on The Andy Griffith Show. In the role, he portrayed the deputy sheriff in the slow-moving town of Mayberry, NC.
Barney’s personality in the show is very by-the-book, egotistical, and a know-it-all, but he’s also very insecure with low self-esteem at the same time.
His reason for leaving the town of Mayberry on the show was to join the police force in Raleigh, N.C. instead. He only appeared in a few episodes again after he left town.
Don’s Emmy awards for his role on the series include Outstanding Performance in a Supporting Role by an Actor or Actress in a Series in 1961, Outstanding Performance in a Supporting Role by an Actor in 1962 and 1963, and Outstanding Performance by an Actor in a Supporting Role in a Comedy in 1966 and 1967. Quite impressive!
Source : https://www.distractify.com/p/why-did-don-knotts-leave-the-andy-griffith-show