As much as possible, the position your child is in when in a carrier or sling should mimic their natural position. This may change depending on your child's age and even if they are awake or asleep. It's very important to understand that awareness of the position of your child in a sling or carrier is not just important when you are putting them in, but its something to be monitored regularly as you go about your day carrying your baby.
Younger children tend to naturally hold their bodies in a J shape with their back gently rounded. As they get older they tend to 'straighten out' but this process can take longer than you'd expect, with many children still having a natural curvature to their spine until around 18 months old.
Your child will probably feel most comfortable and secure with their weight being supported from below and the ability to have their arms close to their face if they so wish. A position that it is useful to aim for is one where the child's pelvis is tilted, their back allowed to naturally curve and their knees and elbows bent.
Babywearing is extremely safe. It has been practised across the world for centuries by many people, in many carriiers in many different ways.
The most important thing to consider when looking at safety in slings is you child's airways - is there room to breath? There should be absolutely no fabric covering your child's face at all. This includes sleeping hoods and hats - make sure they cover the head if needed, but not the face. Also - consider your child's position - is their chin on their chest? If so, they could find it difficult to breathe, so its recommended that you change positions immediately. For this reason I don't recommend horizontal cradle positions, instead an upright position is preferred. If carrying your child on your front, their head should be positioned somewhere between your breasts and your chin. If you don't have breasts, then somewhere below your chin is fine. That way you can see where you are going! If you are carrying your child on your back, ensure you are able to monitor their breathing by feeling their breathe on your neck or being able to see them by glancing over your shoulder.
Essentially there are two ways to make sure your child stays safely in a sling or carrier - ensuring that they have adequate support below them with no room to slip through and making sure than their back support is high enough that they are unable to lean too far and flop out.
Finally, be aware of external hazards such as tripping over things or bumping into things beside or above you. Remember, tripping or falling with your child in a carrier is likely to result in a better outcome for you and your child than if you were carrying them in your arms as you often have hands free to protect your child and or break your fall.