Fortunately for Sherlock, he has a brother who cares for him. Mycroft -- the smarter, more successful sibling -- has obviously known about his brother's heroin addiction for a long time, to the point that he recognizes subtle signs that Sherlock might be about to relapse. Mycroft also knows that, left to his own devices, his brother's smack habit would be the death of him. This is why he sets up incredibly complicated crimes for Sherlock to solve, a la The Game.
First, Mycroft hired an actor named John Watson.
When Sherlock first meets him, he lists off a bunch of facts he deduced about John. These include that he fought in Afghanistan, was a military doctor, and has an alcoholic brother who just broke up with his partner.
Later, John acts amazed. Most of what Sherlock said is true, he claims, before correcting brother to lesbian sister. What's notable is that, over the show's next 15 hours, we see no evidence to support any of Sherlock's claims about John. In fact, the show actively goes out of its way to highlight how flimsy each deduction is.
For example, in the Season 2 finale, Sherlock dramatically jumps off a building to save the lives of those closest to him. This results in the biggest cliffhanger since "Who shot J.R.?"
Except this time fans had to wait TWO YEARS for the solution, because British TV is cruel.
On the ground, to see if he's alive, John grabs Sherlock's wrist and checks his pulse. This doesn't seem like a big deal, except that in an emergency situation and with an unconscious patient, a certified physician would have been trained to check the pulse in the neck. Here's an actual doctor saying exactly this. As an army doctor, John wouldn't just forget this. It would have been drilled into him again and again until he'd have this basic medical information down to a habit. And just in case he forgets in his moment of shock and confusion, there is a passing doctor doing just that as John approaches the body, yet he still reaches for the wrist.
Those shoes were white before he stopped to help.