Q.putting a potted golden barrel cactus in the ground
We have a large (20″ diameter) golden barrel that has lived in a pot for years. We want to place it in a succulent planting. My question is about the darkened, dried part of the plant. The soil has gradually washed away so that about 6″ of trunk is exposed. Is it safe to bury this darkened trunk, or am I risking rot?

Make sure you orient the cactus in the same location that it is growing in the pot. Mark the south side and place the plant in it's new home in the same orientation.
The roots can be trimmed to not extend past the diameter of the cactus.
Make sure it is a well draining area, and not one that will hold or collect water.
Dig the shallow hole and plant the cactus deep enough to just cover the soil line on the cactus. Don't place it beyond this point on the cactus.
Tamp the soil and do not water for the first 2 weeks.
You may need to provide some shading for the first couple of months in it's new home.
https://www.gardeningknowhow.com/ornamental/cacti-succulents/barrel-cactus/barrel-cactus-care.htm