Avoda Zara (12b) Our Rabbis taught: One should not drink water in the night; if he does drink his blood is on his head, for it is dangerous. What danger is there? The danger of Shabriri. But if he be thirsty, how can he put things right? — If there is another person with him, he should wake him and say: ‘I am a thirst for water’. If not, let him knock with the lid on the jug and say to himself: ‘Thou [giving his name] the son of [naming his mother], thy mother hath warned thee to guard thyself against Shabriri, briri, riri, iri, ri, which prevail in blind vessels.’
Shulchan Arukh (Yoreh De'ah 116:5) One must refrain from putting coins in one's mouth, lest it's covered with dried saliva of those afflicted with boils. He should not put the palm of his hand in his arm pit, lest his hand touched a metzorah or a harmful poison. He should not put a loaf of bread under his armpit, because of the sweat. He should not put a cooked item or drinks under the bed, since an evil spirit rests on them. He should not stick a knife in an esrog or a radish, lest one fall on its edge and die. Hagah: Similarly, he should be careful of all things that cause danger, because danger is stricter than transgressions, and one should be more careful with an uncertain danger than with an uncertain issur. They also prohibited to go in a dangerous place, such as under a leaning wall, or alone at night. They also prohibited to drink water from rivers at night or to put one's mouth on a stream of water and drink, because these matters have a concern of danger. It is the widespread custom not to drink water during the equinox, and the early ones wrote this and it is not to be changed. They also wrote to flee from the city when a plague is in the city, and one should leave at the beginning of the plague and not at the end. And all of these things are because of the danger, and a person who guards his soul will distance himself from them and it is prohibited to rely on a miracle in all of these matters.