I accidentally clicked on the detach icon on the layer side panel of QGIS and now it floats and I cannot get it back to the side bar where I want it.
Double-clicking the title bar of floating windows on MacOS will maximize the floating window instead of docking it. I tried dragging the floating window to the approximate location of where the panel was docked but it didn't work. I restarted QGIS 3.6 and dragging the window appears to work again, and other panels will "slide" out of the way to make room for dropping the floating panel.
Inability to dock floating "Layers" panel is still a bug in QGIS 3.10-5 (LTR) on Windows 10 1909. However, as others have suggested restarting QGIS then immediately double-clicking the "Layers" title bar successfully docked it for me.
This is reported as 2 related bugs in the QGIS GitHub issues page here: