I suppose you are serious about learning piano and want to build a solid understanding of music harmony. In that case, you should include practising major and minor chords and their inversions in your daily practice routine.
Take this free course and learn how to memorize all major and minor chords on the piano. I will also show you a simple trick that helps my students to memorize the chords in all tonalities quickly. However, it is not enough to simply memorize the chords in their basic position. If you want to move smoothly between chords, you have to practice chord inversions, and this will open up freedom to play along millions of pop songs.
Print out a chord chart in which chords are divided into groups according to their shape.
Practice playing chords and their inversions along with the video until you play them fluently.