On the trim pump there are two solenoids.
Top one (Trim up) with large blue wire and small blue with white stripe.
Bottom solenoid is the same but colors are green.
If you test the small blue wire as connected to the up solenoid with meter, someone can flip trim switch on control, and you see if meter shows voltage.
Note, dump the volt meter for most simple electrical tests for a 12vdc boat and get a test light!!! A light shows bright to dim based on current. Bright means good power to test point.
A volt meter will amost always show 12volts regardless of amperage as long as there is some.
If you see the switch activating the solenoid but the solenoid is not working then the sokenoid is most likely bad.
Note: the trim up swith only works based on trim limit switch sstting and when the drive is at that point, the trailer button will finish raising drive.
As BT Doc said, when trim swith malfunctions, have you tried the trailer button to see if that works?
If it does and the drive is down and trim up dosesnt work but trailer button does then it could be the trim switch.
If niether trim switch/button do the same intermitten problem, most likely its a trim solenoid.