I took apart my pc fully(don’t ask why) and when I put it all back together and tried to turn it on there was no power. Like at all. So I took it apart to find this loose cable but it does not stretch anywhere. Please help on what you think is the problem is or where this wire goes. Thanks.
From your description is is a molex power cable with a loop through which would go to a second drive.
This is not the reason your PC won't boot.
Have you checked that power is getting into and out of the PSU and to the motherboard?