A "new MB, ram and a CPU" and old case, old PSU, and old OS on the old boot drive which try to work but seems to end up in a boot loop.
Check to confirm that your CPU is on the QVL which is here:
https://www.asus.com/us/Motherboards/PRIME-Z370-P/HelpDesk_CPU/. If it is on the list, you might want to confirm that the BIOS version on your motherboard supports the CPU you have.
Reread your manual (
https://www.asus.com/us/Motherboards/PRIME-Z370-P/HelpDesk_Manual/) to see if you missed something.
Consider well thought advice, like
https://www.computerhope.com/issues/ch000607.htm
Then you can try...
1. Reseat your RAM. Try boot
2. Reseat any cards. Try boot
3. Chipset on this is Z370 and unless the old board is the same, the old OS (Win10?) on your old boot drive can be confused by drivers that do not match. Solve by doing clean install of OS. Try boot
4. Confirm you have plenty of thermal paste available. Remove CPU and examine for bent pins. Correct any issue. Clean and reinstall with fresh paste (pea sized). Try boot.
5. At this point, you may want to get help. If you want to try further, remove everything from the case and rebuild 'on the bench'.
6. Swap parts with known good parts.
7. Following motherboard manual, do a part and test rebuild (add a part per manual and test - error should be for next part - if error is still for part you just installed then you have a probable culprit)