The Midrash states that Moses asked G-d, ‘In what merit do the Jews deserve to be redeemed from Egypt? G-d replied, ‘In the merit of the Torah that they are destined to receive.’ How could the merit of the future acceptance of the Torah help them in their present situation? Rather, they longed each day for their redemption so that they could receive the Torah – and the merit of this yearning brought about their Redemption. The same is true now: The merit of our yearning, longing, and praying for the final Redemption and for the revelation of the Torah of Moshiach is in itself sufficient merit to bring about our final Redemption.
(The Rebbe, as quoted in Yalkut Moshiach UGeula by Rabbi Dovid Dubov)