This very basic feature, a necessity of all 3D applications, is missing from the engine.
It has long been complained about - there is a thread with 55 votes to add it, go there and vote + comment (Missing Feature Request (common in all 3D applications): lock (disable) actor selection in viewport - #24 by KimLaughton). Posted over 2 years ago and still nothing.
It is honestly mind boggling how this still hasn’t been added. Reflects very poorly on the state of UE.