Using the service manual, locate the procedure for removing the system board (you don't need to remove it, but it shows where the connector to the hard drive goes).   If the latch is still attached, simply reconnect the cable and secure it with the latch.   If the latch is broken or missing, that's another issue entirely.  It's not going to be available as a a separate part.    If you do not need the  drive (i.e., can run the system from the M.2 drive), it'll be simpler to just remove the drive. If you do need the drive, the only sure path forward is to replace the system board.  The alternative is to locate someone selling an otherwise dead mainboard that has the latch and harvest the part from it.  Hopefully it will just be a loose cable and the latch will be intact.  If you accidentally tugged on the latched cable though -- it may be the latch is  broken or missing.
Laptop is making loud noise, when I opened my laptop I see this piece came out, I would like to know how and where to connect it ? 
SATA Hard Drive Adapter Interposer Connector