Light: Keep them in a warm, well-lit area with plenty of bright, indirect sunlight until they are well-established. Once mature (2-3 years), grow them in full sun.
Soil: Keep seedlings and immature plants in a slightly moist soil until they attain a bit of growth. Once they develop a couple of “leaves” you can allow the soil almost dry out between watering and then water thoroughly. Use a pre-mixed cactus soil, or make your own cactus mix using humus, sand and clay. Outdoor plants need light, airy, well-draining soil with plenty of sand mixed in.
Water: Mature plants are very drought resistant. Allow the soil to dry out thoroughly. Wait until the cactus looks a bit shrunken, then provide a deep, slow watering.