If you managed to break your frame on a ride, it’s unlikely that you should continue riding from a physical perspective. The effects of shock or concussion can set in slowly and when you least expect them to.
However, assuming you are currently pumped full of adrenaline, have noted the correct number of limbs are still attached, and want to get out of the woods, you need to put the bike back together well enough to carry or push it out.
At this point, your options are to strap the two parts together by attaching the front wheel to what’s left of the main frame triangle or to attempt to lash the head tube back on to the other tubes.
Attaching the front wheel to the main triangle gives the bike a measure of stability and may let you “wear” it like a backpack.
Lashing the bike back together depends on the tubes being suitable shapes after the crash. In this case, stretch backpack straps from the head tube to the seat tube. Alternatively use the straps or an inner tube to lash a large stick across the break. This may provide enough strength to keep the frame rigid enough to push the bike out.
Don’t worry about “saving” the frame at this point. Unless it’s a custom Ti frame, the cost of rebuilding is going to exceed the cost of a new frame. If it is a custom Ti frame, I suggest a different frame maker next time anyway. Do whatever it takes to force the pieces back together sufficiently to make the frame rigid enough to wheel along.