Law is a system of rules created by the state to ensure people can live…