Pinpoint where the mattress is sagging. If it is only sagging in a particular spot, the remedy may be different than if an entire side or other large area in the mattress is sagging out.
Fold a few old towels up and stuff them under the sagging portion of the mattress to temporarily fix the problem while you work out a longer-term solution.
Check the box spring and make sure that it is not broken -- this can result in the mattress sagging. If it is broken, replace it. For a quick fix, measure the box spring and have a home supply store cut a piece of plywood that is slightly smaller. Place this between the mattress and box spring to return the support to the bed.
Using an electric carving knife, cut a piece of memory foam from a foam blank or mattress topper roughly to the size of the sagging area and place it under the mattress to provide further support. Add a second layer of foam if additional support is needed.