For twenty years the standard advice was never to freeze coffee, and it was given with the confidence of a rule that had been tested. It had not really been tested. It was a reasonable inference from what happens when people freeze coffee badly, which is what almost everyone was doing.
Yes, you can freeze coffee, and for beans you will not drink within a few weeks it is the best storage method available. The rules are: freeze whole beans, in small airtight portions, and never refreeze a portion you have opened. Break any of those three and the old advice becomes correct again.
Why the old rule existed
The failure mode is condensation. Coffee taken out of a freezer is far colder than the room, so moisture in the air condenses onto it immediately, exactly as it does on a cold glass. Water on coffee is bad in two directions: it accelerates staling in the beans it lands on, and if the coffee is ground it clumps and brews unevenly.
If you keep one large bag in the freezer and open it every morning, you condense moisture onto the whole bag, every day, and then refreeze it. Doing that repeatedly will genuinely ruin coffee. The old advice was protecting people from a real thing. It just misattributed the cause to freezing rather than to cycling.
What the freezer is actually doing
Staling is a set of chemical reactions, principally oxidation of the coffee's oils, and like most chemistry those reactions slow down as temperature drops. A freezer does not stop coffee ageing. It slows it enough that a bag can hold something close to its condition for months rather than weeks.
There is a second, more recent finding worth knowing. Grinding beans straight from frozen produces a narrower spread of particle sizes than grinding them at room temperature, because cold coffee is more brittle and fractures more cleanly rather than smearing. A narrower particle spread means more even extraction. So grinding from frozen is not a compromise you tolerate. On most grinders it is an improvement.
The method
Portion the beans while they are fresh, into amounts you will use in one go or within a couple of days. Small zip bags work. So do jars, provided they are properly full, because trapped air is the enemy you are trying to exclude.
Get the air out and seal properly. Freeze.
Take out one portion at a time and grind it immediately, straight from the freezer, without letting it warm up. Do not open the portion, take some, and put the rest back. That is the cycling failure again, in miniature.
What freezing will not do
It will not improve coffee. A bag frozen four months after roasting is a preserved stale bag. Freezing holds a condition, it does not restore one, so freeze on the day the coffee arrives or not at all.
It will not help with coffee you are going to drink this week. For a bag you will finish inside two or three weeks, an airtight container in a cupboard, away from light and heat, is entirely adequate and much less faff. The freezer is for surplus, for a bag you loved and bought two of, or for the good coffee you do not want to drink on a Tuesday.
And it will not fix pre-ground coffee, which has already lost most of what freezing would be protecting. You can freeze it and it will stale more slowly, but you are preserving a diminished thing.
The honest recommendation
If you drink through your coffee in under three weeks, do nothing. Keep it in the bag it came in, folded shut, in a cupboard. Every container we could sell you would be an improvement of a few percent on that, and we would rather tell you so.
If you buy in bulk, or you have found a coffee you want to make last, portion and freeze on arrival, and grind from frozen.
The one thing genuinely worth avoiding is the fridge. It is not cold enough to slow staling meaningfully, it cycles in temperature every time the door opens, and coffee is good at absorbing the smell of whatever else is in there. It manages to combine the disadvantages of both approaches.