Fridge going from warm to cold and back to cold

Temp in fridge fluctuates from 45 degrees for an extended time and then cools back to normal. Freezer not consistently cold enough. But also freezes.