I think we can discuss this concept in two different ways.
The first is that yes, being able to detach oneself from issues and problems temporarily can have an immense effect on stress levels. These stories were written over one hundred years ago. Experts today recommend taking short breaks between work in order to improve concentration, focus and mental acuity. That's precisely what Sherlock Holmes does in between his cases when he takes the time out to appreciate art or music or play his violin. He is basically giving his mind a break so that when he gets back to work, he can concentrate and think better.
The second way of looking at is how the fictional character can detach himself from certain thoughts and emotions that do not help him or serve any purpose. For example, Sherlock Holmes is sometimes described as being distant or cold when solving his cases. He can detach and distance himself from the emotional aspects of the work. He is by no means unsympathetic to his clients or those who need help. But he knows that in order to solve the case and connect the dots, emotions do not assist him and he can detach from them as required.
For most of us, both of these concepts can be a challenge. Many of us have difficulty pushing aside thoughts or ideas to focus our mental energies towards one thing at a time. That is why it's so remarkable, because not everyone is capable of it or good at it.
Chapter V of this great story begins "SHERLOCK HOLMES HAD, in a very remarkable degree, the power of detaching his mind at will."
This is Watson talking, sharing his customary awe of Holmes, but in this case, he has good reason to be so filled with respect. Holmes seems to forget this complex case, and is " entirely absorbed" in the paintings they are looking at.
This has several benefits. First, Holmes can free himself from stress. He gets a break, an escape if you will, from the case. Second, he can focus on the task at hand. This will forever allow an objective view of things. Third, it allows his subconscious to work at solving the case.
It is very easy for anyone to see why it is remarkable to be able to detach one's mind at will. All one has to do is to try to stop thinking. We all have ongoing streams of consciousness similar to those depicted more or less accurately by James Joyce in his Ulysses and by William Faulkner in his The Sound and the Fury. If we attempt to stop thinking we will find that we cannot maintain a blank mind for more than a few seconds. The yogis in India practice meditation by keeping their minds blank for longer and longer periods. No doubt some of them can do this for hours, or even days--but it takes practice and self-discipline. Here is a pertinent quotation from an ancient book translated into English by Christopher Isherwood.
This is the beginning of instruction in yoga.
Yoga is the control of thought waves in the mind.
Then man abides in his real nature.
At other times, man remains identified with
the thought waves.
Patanjali’s first four sutras
How to Know God
What Patanjali means by "thought waves" is the same as the modern term "stream of consciousness." We all have these thought waves going on in our minds continuously. It is interesting to try to practice this form of meditation, which is also an important subject in the Bhagavad-Gita. For one thing, we realize that our stream of consciousness is not really "thinking," but something more like a car engine idling when the car isn't taking us anywhere. A lot of it is nonsense, and it is usually fragmentary and strongly influenced by free-association. If we can stop "thinking," then we can control our thinking better when we do want to think and have something important to think about. Sherlock Holmes evidently did not want to waste mental energy on daydreaming or woolgathering. His extraordinary mental powers, Watson suggests, were due to his being able to control his mind and to focus on a problem until the solution opened up to him.
It may be that all great thinkers such as Albert Einstein and Isaac Newton had the same ability to focus on a single problem until it seemed to solve itself.