Linebacker Reuben Foster was selected to the NFL’s All-Rookie team and showed tremendous potential to be a game-changing talent in the middle of the 49ers’ defense.

But 49ers general manager John Lynch acknowledges Foster will only be able to take his game to the next level if he avoids pitfalls off the field.

“He’s got to stay — he knows it — he’s got to stay clean,” Lynch told Jennifer Chan of ninersnation.com at the Senior Bowl this week in Mobile, Alabama.

“We all know how special of a player he can be when he’s right. So he’s got to figure out how to stay healthy and stay out of trouble, but we believe he will do that.”

Foster was arrested two weeks ago in Tuscaloosa, Alabama, and charged with second-degree possession of marijuana. He was released on $2,500 bond. Foster could be subject to discipline under the NFL’s policies on substances of abuse and personal conduct.

The 49ers visited extensively with Foster before last year’s draft. There were questions about Foster’s surgically repaired shoulder and his character. Still, the 49ers had him rated as the No. 3 prospect on their draft board and traded up to No. 31 overall to draft him.

“We probably spent more time with him than anybody in the draft because we felt like it was necessary,” Lynch said. “We grew comfortable and we felt really good about him. It hasn’t been without bumps, as we all know, but we still believe in him a great deal.”