whirlpool refrigator

My frig will run cool and freeze than at times it won’t come on. I restart it by turning it to the off position than back on it will run quite a long time.
I replaced the relay in it.
Can you help