Select Start > Settings > System > Display.
Scroll down and select Multiple displays to expand that section.
Select the boxes for Remember window locations based on monitor connection and Minimize windows when a monitor is disconnected.
Alternatively try third-party applications like: "DisplayFusion" or "Actual Multiple Monitors"