Ditto what Tracer said. And by sitting up straight, you will actually feel like you're leaning back, but you're not. You'll find it much easier to relax your leg and absorb the movement.
Also, ask your instructor if you can do some lunge line canter work without stirrups - you will definitely tense up and lose balance early on when doing this, but you'll quickly realise that you don't need stirrups to stay on. Because you won't be bracing against the iron you'll be able to get a feel of the movement a lot easier.
The other thing I do to make my leg hang nice and long (which will help your heel stay down in the stirrups because you won't grip with your knee) is as soon as I am mounted I lift my foot up toward my hip (like this
). This stretches my quadriceps (muscle on front of thigh), and also adjusts my seat so I'm not sitting so much on my butt but more on my pelvic bones. I then think "shoulders back" and make myself "stand tall", like I'm about to give a rousing speech to my evil minions.
I also ride with the stirrups one hole longer than my body tells me I want. By doing sufficient work in rising trot with longer stirrups, and then some sitting trot, my legs are nice and long by the time I go to canter, and my seat also more secure as I'm not bracing against the stirrups. If your horse has a jarring trot, however, this is harder to do as it takes a fair bit of physical effort to post from the thighs.
The problem is coming from you tensing up (fear), hunching (which curves your spine, puts you in a chair seat and brings your knees and heels up) and then feeling insecure, which makes you tense up more and it becomes a vicious cycle. It's also quite probable that in all of this you're looking down rather than out, and as they say you end up where you've been looking - look forward and you'll go forward, look down and you'll end up in the dirt! Make your body to do the opposite of what it instinctively wants to do. Practice this all the time - when you're not riding, just walking along the street, stand up straight, put more weight in your heels, shoulders back and chest proud, looking out. Practice when you are riding, at the walk and trot and even at halt. Build up muscle memory. Picture yourself riding like the best riders in the world, or even your instructor or someone you look up to in your barn. Mimic the way they sit (assuming it's correct), the way they hold themselves etc. Practice, practice, practice. And good luck!