Some international law is "voluntary", some is not. You cannot for example commit a genocide by opting out of the law.
And yes, of course, it can sometimes be hard to enforce international law, just like it can be very hard to enforce national laws. It is illegal to murder people in most countries, yet people murder each other and some people get away with it.
And yes, of course, it can sometimes be hard to enforce international law, just like it can be very hard to enforce national laws. It is illegal to murder people in most countries, yet people murder each other and some people get away with it.