Try to do the stretches beforehand… starting small and slow also helps…some complex poses have the predecessor poses that you need to get comfortable with…I would recommend find a professional teacher. And before that do the sun salutations…if you think it is not enough, try to increase the number like 12-24-36-48 etc;) it can grow up to 128 😀
My favorite part of yoga is that there are always poses to fit us perfectly, no matter where we are in our fitness journey! If you find that you're not flexible or strong enough for certain poses, it's absolutely ok to substitute variations on the pose (for instance, doing Downward Facing Dog with knees bent) or do a different, more gentle pose instead, to fit what you need. A Google search is a great help here; you can search "gentle" or "beginner" yoga poses – or even yoga for seniors. Those have great variations that make use of a chair or other supports. The important thing is to find a comfortable way to keep doing those wonderful yoga sessions – it's so good for your body, mind, and happiness. As your practice becomes a habit, you'll grow stronger and more flexible, and be ready to take on more challenging poses. You can do it! Enjoy!
Just like any other skill, yoga is something you practice until you get it right. Make adjustments to your pose by resting part of your body on the ground, or bending half way if you cannot stretch the whole way. If you are not sure, search online the name of the position and "modifications" to see different wahs yoh can make your practice easier for you.