To conform to rules or laws is to obey them.
The new student had to conform to the school’s dress code.
Example picture