Here's a tip I found for learning chords with no pain.
It is all about muscle memory.
Place your fingers in position until you can play the chord correctly. Take your time. Now lift your fingers off the strings just ever so slightly and back down but with little to no pressure 20 times. You don't have to play the chord. It is to instil the position of your fingers into muscle memory.
One day your fingers will find the right position without even thinking. Patience is the key.