What are minimal pairs?
Minimal pairs are two words (a pair) that are identical in all sounds but one. We use them to show which phonemes are distinct, or contrastive in a language. Distinct phonemes are those of which a speaker is aware. We know that two sounds are distinct from each other if, when the sounds are exchanged, meaning changes. This applies to both consonants and vowels.
In (1), when/n/ is exchanged for /m/, the speaker perceives the change in the place of articulation (bilabial to alveolar). The speaker knows that the alternation in the place of articulation alters the phoneme, which alters meaning. The same is true for (2), when /i/ is exchanged for /ɪ/. The speaker perceives the change in the height of the vowel (tense vs. lax), thus perceives an alteration in the phoneme, and in meaning.
This would is not the case when two allophonic variants are exchanged one for another. For example, in (3), when the aspirated /th/ is exchanged for an unaspirated /t/, the speaker may perceive an accent, but the meaning is not altered due to the fact that /th/ is not a distinct phoneme, but an allophone of /t/.
Spelling doesn’t matter
When studying the sound system of a language, it is crucial to make the distinction between the orthographic and phonetic representations of words. For example, two sounds may have the same orthographic representation.
On the other hand, one sound may be represented by two orthographies.
(4) is a minimal pair, since we see in the transcription that the change in the vowel sound alters meaning. (5) and (6) are not minimal pairs since the vowel sound is identical in (5) as well as the final consonant in (6). Since there is an alteration in meaning, but not in sounds, we refer to these as homophones (words that sound the same but have different meanings).
So when studying the concept of minimal pairs, keep in mind that orthography plays no role.