In the given figure, when light emerges from the glass slab, the light ray
right of normal AB
As air is a rarer medium with respect to glass, the light ray will bend towards the normal when incident on the first surface of glass slab. Finally, when light emerges out from the glass slab to air, it deviates away from the normal as the ray is moving from denser to rarer medium.
The given figure will clarify the concept :