Light waves have the property of travelling in a straight line, unlike sound waves. When we put a cardboard between the light source and our eyes, the light waves are obstructed by the cardboard and cannot reach our eyes, which doesn't happen when the cardboard is inserted between sound source and our ear.