FORD Escape 2006 XLS 2.3L Manual 4×2

I just bought a FORD Escape 2006 XLS 2.3L Manual 4×2. VIN: 1FMYU02Z16KD48532.

Here is my question.

When the car is driven for a while 10mins + or so and the car is idling (running but I am not pressing the gas pedal) there is a high pitch sound that is very annoying. When I press the gas pedal it goes away as soon as the RPM’s are lowered the whine begins again. Yesterday I got to my garage and noticed the engine goes below 500rpms when I completely stop the car and almost wants to turn off, so i decided to turn on radio, A/C, and lights and the car just shut off. I was able to turn it back on, it almost seems as if the car looses a lot of power sometimes and does not keep constant RPM while idle or stoppped. I made a video of the sound here: https://drive.google.com/file/d/0B8ET69qI9tY5M2JDb255bTAtYkk/view?usp=sharing