It looks like a real mess but it is actually pretty much connecting color to color.
How do you know if your ballast is out?
If you replace all the bulbs with new ones and you have power in the black wire powering the ballast… You almost for sure have a bad ballast! (If the white common line is broken or disconnected you will not have power either, but that is extremely rare)
Happy wiring! And be safe…