Couple ways to do it. One is to use an Edge Split modifier, adjust the angle at which you want an edge to be sharp, or mark specific edges sharp as needed. The other is to add additional edge loops on either side of where you want the sharp edge.