Power chords are chords built from the root note and the perfect fifth interval. They do not contain a major third nor a minor third interval, which would give the chord a major or minor quality respectively.
C major = C E G
C minor = C Eb G
C5 power chord = C G
D major = D F# A
D minor = D F A
D5 power chord = D A
Etc. This does not work for the diminished chord in a key, because that has a diminished fifth interval (not a perfect fifth interval).
B diminished = B D F
B5 power chord = B F#
Therefore, you can play a power chord as a substitute for any major or minor chord.
For beginners, this can be very useful to play F or B chords when they don’t have enough strength to play barre chords.
But power chords are used a lot, not only by beginners. As the name indicates, power chords sound very strong. That’s why they’re often played in e.g. rock and metal music, rather than the full major or minor chord.
Let’s put this to practice with the very common I V vi IV progression in the key of C.
You could strum the open major and minor chords, either as a full chord or a triad:
C major, G major, A minor, and F major
Alternatively, you could replace all of them by their power chord version:
C5, G5, A5, F5
By doing so, you are taking away the major or minor quality from the chord, but that’s ok. Your ears will tell you what they really are, because other instruments, vocals etc all together form the harmony.