My car makes a really annoying noise and sometimes dies right after

When I start my car up it makes almost a moaning noise then it will keep making it randomly, normally it's when my foot lets off the gas and when I put my brakes on. If I put it in park or sit too long at a light it will make that noise then a higher pitched noise then die. While making that noise my RPMs way up and then back down until my car completely Dies

My car has 175000 miles.
My car has an automatic transmission.

– My car makes a really annoying noise and sometimes dies right after