In a new memoir, the actor reflects on being typecast in his twenties, his struggles with addiction, and learning to like John