Who agrees with this saying?

The saying is; God gives us what we deserve. 
It’s a popular saying that people like to use but I’m curious about it. Does He, really? So if you have a bad husband, bad friends, family members, colleagues etc, it’s because you deserve it? If bad things happen to you, it’s because you deserve it? Please share your thoughts…