Mattresses accumulate various stains through the years just from standard use, which also means there are loads of methods to help get them out.
If you’re just working with general stains, the best method is a gentle laundry detergent or dish soap, mixed with lukewarm water. You can use your usual laundry detergent for this and just a spray bottle if you have one to lightly coat the stain with the mixture.
Once you’ve sprayed the stain, gently dab it with a clean cloth or sponge to help lift as much of the stain as possible. Remember never to rub the stain - this can spread it and make it much harder to draw out so always dab and repeat.