You should move slowly when making changes to this part of the routine. Let your child do what is comfortable and familiar for most of it, and change a short part of it. This could be at the beginning of quiet time when you usually snuggle or at the end before falling asleep. Either way, your child should be able to ease into something new and phase out the old. You can even make changes for 1 minute increments. For example, if your child is used to laying down with you for 20 minutes, then for the first minute of the routine, sit next to them for 1 minute, and then lie down. If you continue building this time at just 1 minute per day, eventually you are going to sit there long enough for your child to fall asleep.
If you do it in the reverse order, it may work better for children who cannot sit still unless you snuggle them in the beginning. If your child is too awake or restless, go ahead and pat/rub your child until they fall asleep while you sit next to them. The next goals can be to pat/rub less of the time (intermittently) and build independence.
Let your child know that you need to step out of the room quickly to grab something, after staying with him/her for several minutes. Exit quickly and return right away. Leave like this consistently and extend the time slowly. Build it up to 15 seconds away, then 30 seconds and so forth. Your child will learn to trust you and wait for you to come back. Your child will eventually fall asleep waiting for you to come back. After this happens a few times, you can leave sooner. It is always good to spend 5-10 minutes with your child before leaving them to fall asleep. If your child calls you, continue to build trust by responding and add extra check-ins, at times.
You may need an even slower option to teach independence at bedtime and naps. Your child may need you to be more subtle. Use a chair to sit near your child. Move the chair 6 or so inches towards the door, from day to day. Eventually your child will fall asleep when your chair is at the doorway. The next day, you will move the chair around the corner and respond using your voice or appearing when you are called. Checking in on your child when you aren’t called may help to cement trust and reassurance. Do this as long as you need to.