to NGA
I hate to be the barer of bad news but its too late for the Hylocereus - its tipping over because it is rotting. The yellow cactus head can't be saved unless you find another recipient to support it as it contains no chlorophyll. The yellow cactus (a Gymnocalycium) is essentially a parasite on the Hylo. The Hylo is supporting both plants and eventually, the Hylo always loses the battle.
If you could find a section of the Hylo that hasn't rotted (just below the Gymno), you could possibly root that piece. Cut the Gymno off the top and the roots off the bottom. Keep cutting slices off the bottom until you find healthy tissue. Let the piece dry for a week or longer and then balance the bottom end on some damp cactus potting soil - make sure the cut end is making good contact with the soil but don't bury it. It will either root or rot. This is a long shot but possible.