Mysteriously, a rectangle has appeared in the middle of the screen. How to get rid of it?
A floating black rectangle appeared on my Mac screen after upgrade to High Sierra operating system. It is due to an Accessibility option and can be removed as follows:

System Preferences > Accessibility > Zoom > Options > Show preview rectangle when zoomed out

I do not know how it appeared, but I am glad that it is gone.