The word "compulsory" means "required". Talk about things that someone is required to do by law this way:
In my country, military service is compulsory for all male citizens.
Attendance is compulsory.
I think they have a compulsory voting system there.
The word "compulsory" is very legal-sounding. We don't use it much in daily conversation.