What is a good way to keep my back aligned or put it back into alignment?

Exercise or chiro. Alignment means different things to different people. Most of us keep our spines in good postion with exercise esp core strenghtening. Others rely on chiropractors to "re-align" their spines with adjustments.
Stretch. Stretching exercises are very beneficial as well as strengthening of your core muscles in the back and abdomen. A few sessions of physical therapy can get you on the right track.