The decision whether "ch" or "sch" should be written depends on the pronunciation in Standard German.
- Unterschied is pronounced /ˈʊntɐʃiːt/, hübsch is pronounced /hʏpʃ/; notice the /ʃ/ sound, which corresponds with the sound of "sh" in the English verb "should".
- Vergleich is pronounced /fɛɐˈɡlaiç/, hässlich is pronounced /ˈhɛslɪç/; notice the /ç/ sound for "ch".
/ç/ is the German "ich-Laut" or voiceless palatal fricative. It requires a bit of practice if your native language does not have this sound.
The sound /ç/ is easy to confuse with the so-called Ach-Laut, which is a voiceless uvular or velar fricative (/χ/ and /x/, respectively; even the IPA symbols are very similar). You can find the Ach-Laut in lachen (/ˈlaxn/) and Loch (/lɔx/), for example.
There are a few cases where you need to be careful. For example "bisschen" is pronounced /ˈbɪsçən/ because the "chen" is used here to refer to something small (see "chen" for diminutive forms) and is not part of the same syllable as the last 's' of "biss". However, "Groschen" is /ˈɡrɔʃn/.