They always say respect is earned, not given

So how do you earn respect? Specifically in a relationship? Or I n a relationship that is established and has been through ups and downs?