I don’t know how else to put it.
Here is an English summary of the highlights in a pseudo-halachic discussion of eating food left under the bed:
One may not store food and drink under a bed, even enclosed in metal, and these receive an “evil spirit”, and so should not be eaten. As the Shulchan Aruch (Y.D. 117:5) says:
ולא יתן תבשיל ולא משקים תחת המטה, מפני שרוח רעה שורה עליהם… וכל אלו הדברים הם משום סכנה, ושומר נפשו ירחק מהם ואסור לסמוך אנס או לסכן נפשו בכל כיוצא בזה. (ועיין בחושן משפט סימן תכ”ז).
- It is customary to be lenient if the food was under a mattress or pillow or plane seat or a recliner (even though it is sometimes used for sleeping) or in a sleeping man’s pocket.
- If it was under a child’s bed or stroller or double-decker bed, there is doubt. Some say the food is permitted if no one slept under the bed, or if it was slept on during the day, but it’s better to be stringent since the Gemara doesn’t go into these details.
- If medicine was left under the bed, there is room to be lenient.
- Some say one person cannot forbid another’s food (אין אדם אוסר דבר שאינו שלו – responsa Rav Pe’alim).
- For more of this (Cooked or uncooked? Esrog for Succos? Chanukah oil? Hefsed Merubeh? etc.), see here.
The ugly truth is, there is no good proof for any of this. Since we don’t observe any danger in our time, we have no tools to analyze any of this. One needs to take some general approach, and either forbid everything or permit everything (see Pischei Teshuvah on the Shulchan Aruch).
There are hundreds of such pointless discussions in the Achronim and countless ink poured.
If you don’t know something, just admit it!