It's not so clear here, so here's an explanation for how Tanjirou snapped Tomioka out of his funk.
The key were two verbs Tanjirou included in his sentence: 託する (takusuru; for "entrust") and 繋ぐ (tsunagu; this one is tricky, "connect/fasten/preserve (without being severed)/keep (something entrusted) going")
https://mangadex.org/chapter/468541/6
What Tanjirou said to him was more along the lines of "Giyuu-san ... What(ever) Sabito had entrusted to you ... are you not going to keep it going?"
https://mangadex.org/chapter/468541/8
託する and 繋ぐ were then repeated at the end of Sabito's monologue: "You absolutely mustn't die. The life that your sister (staked her own life to) preserved, and the future that she entrusted to you ... you have to keep them going, Giyuu."
(Note that both "preserve" and "keep going" here had incorporated 繋ぐ Honestly, its metaphorical usages are irritating translation-wise, yet "keep going" isn't exactly the prettiest choice. Maybe "continue/follow through/keep alive"?)
Long story short, it still doesn't change the fact that Tanjirou lucked out with finding the right thing to say to Tomioka that reminded him of Sabito's words, but I hope this clarifies things.