As the Buddha instructs in the Majjhima Nikaya, "Develop a mind that is vast like space, where experiences both pleasant and unpleasant can appear and disappear without conflict, struggle or harm. Rest in a mind like vast sky."
Probably MN 62. It's not a direct quotation, but I think it's an accurate restatement.
"Develop the meditation in tune with space. For when you are developing the meditation in tune with space, agreeable & disagreeable sensory impressions that have arisen will not stay in charge of your mind. Just as space is not established anywhere, in the same way, when you are developing the meditation in tune with space, agreeable & disagreeable sensory impressions that have arisen will not stay in charge of your mind.
"When one thing is practiced & pursued, ignorance is abandoned, clear knowing arises, the conceit 'I am' is abandoned, latent tendencies are uprooted, fetters are abandoned. Which one thing? Mindfulness immersed in the body." -AN 1.230