Well I wouldn't just start replacing parts willy nilly. That gets expensive. Don't ask how I know

You need a multimeter. A decent one can be had for $15 and it is a must for boats. You will want alligator clip leads too. First do a continuity test or resistance test between the ground wire on your trim pump and your batteries ground, or grounding bus bar. You should have continuity. Or your ohms reading should be less than 1 ohm. Then do a continuity test or resistance test between the solenoid ground and your battery's ground/grounding bus. The ground for your solenoid and trim pump may be the same wire. If you do not have continuity, or your resistance reading is greater than 1 ohm, your ground is your problem.
If you have a good ground, then switch the multimeter to voltage. Take the multimeter leads and put one on the ground and one on the blue wire on the solenoid. Hit the trim up button on your switch. Are you getting at least 12v? If not, you are not getting a signal to your solenoid from your switch. So you will have to follow that wire back.