Sherlock noticed John.
Of course he did. That is his job, that's what he does. But he let John think he has escaped Sherlock's consciousness for the moment because he's just gotten a lead on that really interesting warlock case, and also Sherlock isn't ready yet.
He knew, that when John broke up with him after his accident, that something was up. John thought he had won and Sherlock let him, at least for the moment. John's sudden unhappiness with their relationship was obviously a lie and Sherlock simply had to figure out why the change of heart. Naturally, he went to Lestrade, who had refused to speak to him for several days before finally giving in and telling Sherlock what he wanted to know.
John, slowly being poisoned and waiting to die.
Sherlock filched the poison from the evidence in the Ministry of Magic and began to work on an antidote. While a bezoar might heal common poisons, it was no match against specialized ones like this. And Sherlock was sure it was specialized. He was sure, in fact, that it had been made just for John. So there were three parts to this puzzle: one, brewing an antidote; two, giving the antidote to John; and three, finding out who wanted his boyfriend dead. Simple.
However, simple doesn't mean easy.
The potion was taking much longer than Sherlock anticipated. He was getting close, but he was still missing something. Until the day after Sherlock saw John, when it hit him: the poison was made for John. So John must be a part of the antidote.
Immediately Sherlock started adding bits of John to the potions. He broke into John's tiny, abysmal flat and took some hairs from his brush, some clipped nails from his trash. It took another day or two of experimenting, but Sherlock finally got a batch that worked.
He made his way back to the Leaky Cauldron as quickly as he could, only to find that John was not in his usual seat by the window. Sherlock, fearing the worst, apparated to John's flat and broke in to find that John was asleep on his bed, though he was obviously in pain. His forehead was doing that scrunchy thing that Sherlock had only seen when John had broken some ribs in a Quidditch accident during his fourth year. Sherlock's heart contracted, but he ignored it in favor of going over to his boyfriend and shaking him awake.
John struggled against him, but as Sherlock had predicted, he couldn't find the strength to attack. "John," he said, sliding an arm under him and helping him to sit up. "You need to drink this."
John groaned, tucking his head against Sherlock's neck. He muttered something that might have been an approximation of Sherlock's name. "Yes, that's right, it's me," Sherlock replied, his voice deep and soothing. He held the flask to John's lips and practically poured the antidote down John's throat. Once it was gone, Sherlock lowered John to his bed, then sat on John's kitchen table to keep an eye on John and think.
It took a few hours, but eventually John's forehead smoothed out. His color improved and his breath wasn't as labored. It wasn't long before he opened his eyes, looking around. He stopped when he saw Sherlock and rubbed his eyes. "It wasn't a dream," he said with a sigh.
"You're an idiot," Sherlock told him. John made a sound like a laugh. "No, really you are. If you had just told me what was going on instead of trying to break up with me, then I would have had the antidote sooner and you wouldn't have almost died."
John heard what Sherlock was trying to say, he always did. He opened his arms and Sherlock crossed the room to lay down next to John. Sherlock pressed his cheek to John's chest, hearing John's beating heart. Sherlock shuffled closer and John pet his hair. "I promise I won't break up with you again," John said, his voice serious.
"Even if you're dying."
"Yep, even if I'm dying. You're stuck with me until you don't want me anymore," John replied easily.
"Impossible," Sherlock sniffed. "I will always want you."
John pressed kisses to Sherlock's hair. They clung to each other in silence for a while, unwilling to separate. Finally, Sherlock spoke, his voice husky. "Move back in with me. Let's go—I ran into Professor Hudson. I did some favors for her and she offered us a place to live in muggle London. Let's just be together for a while."
"Alright," John said, pulling Sherlock up to kiss him. John took the kiss for what it was and gentled the frantic edge to it that Sherlock was feeling. Sherlock needed John in so many ways, but he was lucky because John needed him too. Sherlock would never be bored again in his life. John would always have someone to care for. They were going to find out who targeted John and take him or her down together. They were going to start the rest of their lives together soon, but for now, they broke their kiss and laid back down on the bed. John wrapped his arms around Sherlock, hands trailing up and down his back. Sherlock traced John's face, touched where wrinkles would eventually form. Outside the tiny flat, it began to rain, and inside it, two people realized they'd never be lonely again.