The discharge of electrical charges accumulated in clouds can be extremely dangerous at high altitude or in an area where you find yourself being the highest object. If you are caught in a storm, get away from the ridges of hills or mountains, trees and high rocks. Look for a place at low altitude, as flat as possible, and lie down on the ground.
If you can not get away from high objects, such as in the forest, but you have dry, insulating materials, sit on them. Shoes with a rubber sole are quite insulating but they are not 100% safe. If you are climbing, a roll of rope will provide you with good insulation. Never sit on something wet. Tuck your head in your knees and tighten your legs with your arms. Keep your feet in the air and do not touch the ground with your hands, which could allow the lightning to pass through you. If you have nothing to isolate yourself from the ground, lie down in the most flat possible way.
Sometimes you can feel the lightning come through a vibration in the air and phenomena of static electricity, like the hair that rises. If this happens to you and you are standing, throw yourself to the ground immediately, putting yourself first on all fours. So, if you are unlucky by lightning, it will take the easiest way (arms or legs) without going through your torso and will probably spare your vital organs. Lie down as fast as you can.
Keep metal objects away from metal structures and barriers. However, do not throw away your equipment as you might need it after, especially when climbing. Being close to metal objects, even without touching them, is dangerous because of the shockwave that would be emitted if struck by lightning, which could damage your organs, especially your lungs.
The best place to shelter from the thunder and to be at least 1m inside a hole at least 1m from the walls. Do not stay in a cave in the mountains. In fact, the lightning can penetrate through the rock through the cracks in it and into which very conductive water flows.
Feel free to leave a comment if you have anything to add or discuss!