I'm trying to light up the 8 LEDs in order using 74HC595 shift register, but it won't turn on.
The positive rail is on 5V and the negative rail is on GND.
Your first mistake is not telling us what your problem is. What is the sketch meant to do vs what it actually does ?
Please post your sketch, using code tags when you do
Posting your code using code tags prevents parts of it being interpreted as HTML coding and makes it easier to copy for examination
In my experience the easiest way to tidy up the code and add the code tags is as follows
Start by tidying up your code by using Tools/Auto Format in the IDE to make it easier to read. Then use Edit/Copy for Forum and paste what was copied in a new reply. Code tags will have been added to the code to make it easy to read in the forum thus making it easier to provide help.
➜ Please do yourself a favor and read How to get the best out of this forum. Post accordingly, including code with code tags, necessary documentation for your request such as your exact circuit and power supply details, links to components, etc.