My DD who has never had any problem settling herself to sleep had a nightmare a few days ago (we have talked about it and the nightmare is now 'gone'). She has forgotten how to get to sleep on her own and needs me or DP to stay until she falls asleep, which is only about 5 mins.She needs her confidence back any ideas what to do. Currently I'm at the stage where I sit on the chair at bedtime with no conversation to reassure her, but when she wakes in the night she screams as we are not there.
There is a book called "Sweet Dreams" you might read to her - lots of pictures with flaps to pull out and ideas like checking under the bed for monsters. The parents in the book are not in the room when the child falls asleep. But your lo is only 2 so it might take some time for her to re-learn falling asleep on her own; don't worry too much as it will probably sort itself out in due course.