Engine surges to about 900 rpm when I put it in Drive or Rev. on 2004 Dodge Ram 2500

When I let off brake it takes off and then is fine until I want to stop.I have to shift to N to stop for fear of burning up brakes and trans.

Asked by for the 2004 Dodge Ram 2500