A common method of implementing hate speech laws in other countries is basically that many countries have laws against inciting hatred. Or inciting violence.
Basically, the idea is that the speech can’t be prosecuted for being offensive, but rather it needs to be evidence that the speech is in someway harmful.