Windows
1. Make sure InDesign is the active application.
2. Press Alt + Space then M(Move).
3. Press the Down Arrow key to start moving the window.
4. Move your mouse downwards to bring the window back onto the screen, then click to position it.
Alternatively, press Windows + Shift + Left/Right Arrow to move the application window between monitors. Windows + Up Arrow can also maximise the window.
macOS
1. Try Window > Application Frame in InDesign. Toggle it off and back on to see whether the window repositions itself.
2. Hold Option and double-click a visible corner of the application window. This can resize the window and bring its title bar back into view.
3. Open Mission Control (F3) and try moving the InDesign window to the other display.
4. Alternatively, go to System Settings > Displays and temporarily change the display resolution or arrangement. This can expose the hidden title bar so you can drag the window back into position.
This is a known issue with InDesign, particularly on Macs using multiple monitors. There's no need to unplug a display every time it happens.
If it keeps recurring, I'd also check the display arrangement and scaling settings, as they may be contributing to the problem.