Spoilers for the Three Garridebs and the Final Problem (acd case)
I literally have no words to describe how sad this case was, and I could write a whole analysis on John's "final" words, but I'll focus on Sherlock and specifically Mariana's talk - that apart from standing true on its own, also greatly foreshadows the aftermath of the Final Problem.
After some minutes of Sherlock blaming himself for everything that happened to John, and how he's responsible for bringing him in so much danger, Mariana stops him and states:
The number of things I want to note here:
1) "He would rise up from that bed...the head"
After the final problem, John wishes that Sherlock would come back, in denial of the death he knows as fact. He blames himself for not getting to the waterfall in time, needs Sherlock to rise up from the dead and take all that guilt away-
2) miraculous and unpleasant
John will beg for a miracle, for Sherlock to be alive. His return, and the hurt that John will feel, the feeling of betrayal for the time that Sherlock kept from him that he was alive will be more than unpleasant. A miracle that hurts.
3) "You being here, with him. That's all he'd want you to do. Be here in fear."
Sherlock is motivated by fear to protect John by putting himself in harms way and keeping John out of it, concealing the truth from him (most notable on the fact that he hid the fact that he was alive for three years, in order to take down Moriarty's crime infestation by himself). Mariana reminds Sherlock that they are a team, and that John wants to stand by Sherlock no matter how bad it gets, that they are going through this together and that he wants to protect Sherlock just as much as he wants to protect John. He would prefer they both carry the burden of fear and tackling danger together, than Sherlock shutting him out and endangering himself.
4) "...but with shame? Guilt?"
Probably foreshadowing the main feelings Sherlock will be going through after he realises he will have to cause John and Mariana so much emotional pain (faking his death) to guarantee their safety, and that they both would never want that.
5) "Cause of death. Sherlock Holmes's shame"
Basically my 4th point right above, Sherlock will be "dead" to John and Mariana, ashamed and scared to come back to them after three years.
And then, after a while that these words sink into Sherlock's head and he begins to settle with them, this happens:
"This (John's targeting) serves as a reminder to stay out of my business."
So what will Sherlock do? Knowing he cannot possibly endanger John again while simultaneously taking down Moriarty, he will have to let go, distance himself, sacrifice one of the two possibilities. And letting Moriarty go after such an offence is not an option to him anymore.