I've been taking the basic triad shapes and inversions (I somehow knew these already) and mentally calling out the notes as I play through the triad. Then I'll move through the notes of the traid to hammer it home.
In addition to memorizing the cycle of fourths/fifths as @thehindteet suggests
It is also quite useful to memorize the 'cycle of thirds'
C E G B D F A ( C E G B D F A...)
The notes of triads and 7th chords follow this order, modified by key signature
Also the order of lines & spaces on the staff
For example if you're playing a G triad of some kind,
you know the 3rd will be a B of some kind
and the 5th a D of some kind