I am assuming you are focusing on major and minor chords.
Firstly you should learn what major and minor chords actually are.
Any major chord on the piano can be found like this:
Let us say you want to play a c major chord. Then you start with a C.
The next note should be E and then G. To find this out you just have to start with the C, and then count to 5 and you will find the E: 1 C 2 C# 3 D 4 D# 5 E.
From E you then count to 4 like this: 1 E 2 F 3 F# 4 G.
You can do this with ANY major chord. Let us say You want to play a E major chord then you do this: You start with the note E. Then you go to 5 wich is G# and then to 4 from G# wich is B. So E major is E-G#-B. Does this make sense? When you learn enough chords you will be able to "see" them on the keyboard and you will not have to think about it this way.
Minor:
Instead of going from 1 to 5, you go from 1 to 4. That's the only difference.
So you do like this:
Let us say you want to play A minor. Then you do this: A. 1 A 2 A# 3 B 4 C. And then: 1 C 2 C# 3 D 4 D# 5 E. So A minor is like this: A-C-E. A major would be like this: A-C#-E.
Does this answer your question?
I also do this, but kinda differently. My way, is instead of counting from the first note to the second, I just check the number of keys in between the notes of the chords
For major chords, you have to have 3 keys (including black keys) in between the first two notes of the chord, and 2 keys in between the last two notes. For example in a C major chord, C-E-G, between C and E there are C#, D, and D#. That's three keys. In between E and G, there are F and F#. That's two keys then.
For minor chords, 2 keys between the first two, and 3 keys between the last two
For diminished, 2 keys between the first two, and 2 keys between the last two.
For augmented, 3 keys between the first two, and 3 keys between the last two
It's just that simple

and I think every kind of chord has this similar pattern