There are plenty of ways as history has proven. You can be funny and wise like Will Rogers. You can lead a peaceful movement like Gandhi. You can have a lovable children's television show and never say a cross thing about anyone, like Mr. Rogers. You can be an astronaut (a nice one who doesn't get into stupid stunts like kidnapping others). You can be an athlete who doesn't take drugs or harm women or do any of the other stupid things some athletes do. You can be an entertainer and avoid saying or doing something selfish or dumb on Twitter or on the talk shows. Stevie Wonder comes to mind here.
In this day and age it may be the trend that fame and acting badly go hand-in-hand. But it doesn't have to be this way. And, I believe, fame often comes, unsought, to those who are just nice, decent people in part simply because they are nice, decent people. They may be the exception that "makes the rule", but it sure isn't a bad way to be remembered.