Check your hardware connections
Always check if any of the connection are loose or not open. Say, for example, you want to connect an LCD display with the Arduino, but you got confused about the connection of the wires. Check several times whether you are making the correct connections. Also check for short circuits.