The fridge isn't mine. It came with the house that my wife and I are renting and even though it's not really that old it has a problem with the door after someone banged up the bottom of it by moving it around. You can close the door, but it would open if even slightly jostled.
Closing the freezer door would pop the main door open. There were also times that the door would open on its own. We took to putting a chair up against it, but one day I forgot to do that and it opened up during the day, ruining all the food inside.
I was going to install a new latch or fix the hinge, but I found an even better way: neodymium magnets.
Step 1: Get Some Magnets
If you're ordering for this purpose, I'd recommend that you try and get a variety pack. I was using 1/16" magnets, but a few 1/32" ones would've helped.
Step 2: Stack the Magnets in the Gap
I simply kept stacking the magnets and tested the fridge door to see what was a good fit. This takes, oh, about a minute.
Step 3: Make More Stacks
This solution has been working for me for the past month. You can see the proof in this short video that shows how the problem of the freezer door opening the main door was solved.