Giving advice on back pain on the Internet is something I usually don't do, but I can share my own experience. If not OP, maybe someone else can find help in it. There can be many causes for back pain and many ways to fix it, where fixes for some problems only make other problems worse. I think it's important to try figuring out what you are struggling with first, before doing any kind of preventive actions.
I have had a few strains during heavy lifting (squat and deadlift) and after the last I struggled with it for two years. It wasn't a big hindrance in daily life, but certainly annoying and some activities were affected. I tried stretching (every move imaginable), bending, ice-packs and all that jazz, went to a chiropractor/physio for some time and got a bit better, but never 100%. What really made the difference was when I started watching/listening to Stuart McGill, a Canadian PhD and professor that has a lot of experience with back pain, especially in athletes. He is by many considered one of the most knowledgable on the topic. After listening to different professionals and reading so much about the topic, it was refreshing to listen to Stuarts approach. He does a great job explaining what is happening from a mechanical standpoint.
I watched some Youtube-videos, some with only audio, and bought his book, Back Mechanic. He says "[sic] non-specific back pain is not a thing and that there is always an answer". For many, doing stretches and bending is the opposite of what helps (not saying that's necessarily OPs problem), and that the solution in most of the cases is to avoid positions and movements that aggravate the pain. It's like hitting your thumb hard with a hammer until it gets sore, then keep hitting with less force many times each and every day. That's an equivalent to straining the lower back and keep bending and moving over incorrectly.
I did some self-assessments based on his book and videos, which led to a theory on what is the problem and how to attack it. Working out and stretching was not the solution. If I did work out, it was with light weights and without putting the lower back in an exposed position. I simply started avoiding bending over. Using my legs and keeping the back straight or with very little tilt. Even when getting out of bed (maybe especially since the back is more vulnerable after waking up), putting on my socks, squatting to sit on the toilet. Small changes in the everyday life. That's when I stopped hitting my thumb with a hammer throughout the day. By bending over I wasn't hitting it hard, but just hard enough and frequently enough to keep the inflammation going.
I very quickly started feeling better and after several weeks nearly all the pain was gone. I still kept avoiding bending over, but started experimenting with it here and there. The point was never to avoid those positions for the rest of my life, but long enough for the inflammation to heal.
Now I don't have any pain in my back anymore. I have felt it coming back a little when doing certain exercises, so I avoid that. I still try to think about positioning and movements in my life to avoid aggravating the lower back again, but I bend over here and there and has no problems with it. I may feel a bit sore after a round of golf, but it doesn't last long.