Stretching helps mine. When it is really bad just sitting cross legged and tucking my chin to my chest stretches my lower back. From there working up to being able to touch my toes without bending my knees. Hold stretches for 1-2 minutes, you should hold until the tension release, the hold for about 10 seconds longer. For most muscles that release happens after 10-15 seconds, but the back takes much longer. The tension is a protective reflex where the muscle sense's being stretched and contracts to prevent it. You want to hold the stretch until the reflex subsides and the fibers allow themselves to extend.
Obviously you should only be stretching to tightness, not to pain.
Soft beds make mine worse, sleeping on a carpeted floor helps it.
One legged squats have also helped. I was not doing them for my back, but noticed a major improvement after starting to do them. My guess is the spasms where caused by hip instability and strengthening the stabilizers in my legs helped.
That is just things that have helped me. There is a much longer list of things worth trying. If a back sleeper, put a pillow under your knees, if a side sleeper put a pillow between your knees. Use ibuprofen for pain, add on Tylenol if you have to. Avoide opioids. Also, stay active, yest it hurts, but inactivity makes it worse, not better. And of course use good ergonomics for lifting things.