Cultivate the habit of putting tube caps on immediately you've squeezed some paint out. You'll feel when a tube is starting to harden; the paint stiffens up and it's harder to squeeze out. Make a point of using it up before it dries completely. If it's too late, you'll have to use it for some 3D mixed media piece!
How Fast Does Acrylic Paint Dry Once It's Out of the Tube?
Acrylic Paint Drying Time, Listed by Brand
Tips for Dealing with Stuck Paint Tube Caps