AとBの例は、「イチゴ味とチョコ味」、「オスとメス」、「部品Aと部品B」です。
この場合、次のような言い方ができますよ。
ーthe way to tell the difference between strawberry flavour and chocolate flavour
「いちご味とチョコレート味を見分ける方法」
ーhow to differentiate between a male and female
「オスとメスを見分け方」
ーhow to recognize the difference between part A and part B
「部品Aと部品Bの見分け方」
ご参考まで!