See the diagram.
There are two laws.
1. The incident ray from medium 1, the perpendicular at the point of incidence of ray on the boundary between two media , and the refracted ray in the medium 2 are all coplanar.
2. The ratio of Sine of angle of incidence i to the Sine of angle of refraction r is constant.
When the medium 2 is optically denser than medium 1, the refracted ray bends towards the normal at the point of incidence. When medium 2 is less denser than medium 1, then the ray bends away from the normal.