This initially came from the TV series “The Crown” :
In their regular meeting in this fictional portrayal, John Major, the British Prime Minister at the time, congratulates the Queen on her upcoming 47th wedding anniversary. In return, she asks Major how long he has been married, to which he answers 24 years.
“We must all be doing something right. What do you suppose that is?” asks the Queen.
John Major responds that “One of the most memorable accounts of a long successful marriage comes from Dostoevsky’s wife, Anna. She and Fyodor were, she said, of contrasting character… different temperaments. Entirely opposing views. Yet they never tried to change one another. Nor interfere with the other’s soul. This, she believed, enabled her and her husband to live in harmony.”
Fyodor Dostoevsky was a famous Russian author of Crime and Punishment etc.
I also Googled this and apparently her actual quote was :
“In truth, my husband and I were persons of “quite different construction, different bent, completely dissimilar views.” But we always remained ourselves, in no way echoing nor currying favour with one another, neither of us trying to meddle with the other’s soul, neither I with his psyche nor he with mine. And in this way my good husband and I, both of us, felt ourselves free in spirit.”
― Anna Dostoevskaya - Dostoevsky Reminiscences