Bread goes stale quickly when taken out of the fridge because of a process known as retrogradation. Retrogradation is a phenomenon that occurs in starches, which are a major component of bread.
When bread is baked, its starches undergo a process called gelatinization, where they absorb water and swell. During this process, the starch molecules are organized in a way that helps to give the bread its soft and moist texture. However, when the bread is cooled down, the starch molecules begin to reorganize and recrystallize, leading to retrogradation.
In the fridge, the low temperature causes the starch retrogradation to happen at an accelerated rate. As a result, the bread becomes stale much faster compared to leaving it at room temperature. This is why it is generally not recommended to store bread in the fridge unless you plan to use it quickly, as the cold environment will cause it to go stale faster.
To keep bread fresh for longer, it's best to store it in a cool, dry place, such as a breadbox or a sealed plastic bag, at room temperature. If you don't anticipate eating the bread within a few days, you can freeze it to extend its shelf life. When you're ready to eat it, simply thaw the bread at room temperature or warm it up in an oven to help revive its texture and taste.