SN 22.1, SN 36.6 and MN 21 are a good starting point.
Also MN 62 is directly applicable, instructing to have a mind like earth, wind, fire, water & space.
Rāhula, meditate like the earth. For when you meditate like the earth,
pleasant and unpleasant contacts will not occupy your mind. Suppose
they were to toss both clean and unclean things on the earth, like
feces, urine, spit, pus, and blood. The earth isn’t horrified,
repelled, and disgusted because of this. In the same way, meditate
like the earth. For when you meditate like the earth, pleasant and
unpleasant contacts will not occupy your mind.
Meditate like water. For when you meditate like water, pleasant and
unpleasant contacts will not occupy your mind. Suppose they were to
wash both clean and unclean things in the water, like feces, urine,
spit, pus, and blood. The water isn’t horrified, repelled, and
disgusted because of this. In the same way, meditate like water. For
when you meditate like water, pleasant and unpleasant contacts will
not occupy your mind.
Meditate like fire. For when you meditate like fire, pleasant and
unpleasant contacts will not occupy your mind. Suppose a fire were to
burn both clean and unclean things, like feces, urine, spit, pus, and
blood. The fire isn’t horrified, repelled, and disgusted because of
this. In the same way, meditate like fire. For when you meditate like
fire, pleasant and unpleasant contacts will not occupy your mind.
Meditate like wind. For when you meditate like wind, pleasant and
unpleasant contacts will not occupy your mind. Suppose the wind were
to blow on both clean and unclean things, like feces, urine, spit,
pus, and blood. The wind isn’t horrified, repelled, and disgusted
because of this. In the same way, meditate like the wind. For when you
meditate like wind, pleasant and unpleasant contacts will not occupy
your mind.
Meditate like space. For when you meditate like space, pleasant and
unpleasant contacts will not occupy your mind. Just as space is not
established anywhere, in the same way, meditate like space. For when
you meditate like space, pleasant and unpleasant contacts will not
occupy your mind.