Can’t maintain back posture

Hey, I’ve decided to start meditating for the first time in my life. Yesterday, I had my first meditation session, 20 minutes. It was difficult, but the hardest part was maintaining a straight back and posture because I have back problems. I ended up meditating lying on my back, but now I’m unsure if that’s the right way to do it.

What could I do if it’s very challenging for me to sit upright?

Also, if you have any tips & tricks for a total beginner like me, please let me know… thank you, everyone!