The short answer
Korean letters are put in order in dictionaries and lists using a sequence called ganada (가나다순). It follows the first consonant of each syllable, as in 가 (ga), 나 (na) and 다 (da). The full order used in standard Korean dictionaries is:
Consonants: ㄱ ㄲ ㄴ ㄷ ㄸ ㄹ ㅁ ㅂ ㅃ ㅅ ㅆ ㅇ ㅈ ㅉ ㅊ ㅋ ㅌ ㅍ ㅎ
Vowels: ㅏ ㅐ ㅑ ㅒ ㅓ ㅔ ㅕ ㅖ ㅗ ㅘ ㅙ ㅚ ㅛ ㅜ ㅝ ㅞ ㅟ ㅠ ㅡ ㅢ ㅣ
The simple form of the consonant order
The simple form of the order uses only the 14 basic consonants: ㄱ ㄴ ㄷ ㄹ ㅁ ㅂ ㅅ ㅇ ㅈ ㅊ ㅋ ㅌ ㅍ ㅎ. The double consonants sit right after their plain partners in the full dictionary order, so ㄲ comes after ㄱ and ㅆ comes after ㅅ.
The simple vowel order runs ㅏ, ㅑ, ㅓ, ㅕ, ㅗ, ㅛ, ㅜ, ㅠ, ㅡ, ㅣ. The combined vowels fit between these in the full order shown above.
How to sort a Korean word
Compare words one syllable at a time. Within a syllable, compare the initial consonant first, then the vowel, then the final consonant.
For example, 가구 (gagu, furniture) comes before 가방 (gabang, bag). Both words start with 가. The second syllable of 가구 begins with ㄱ, and the second syllable of 가방 begins with ㅂ. ㄱ comes first in the order, so 가구 is listed first.
A syllable that starts with the silent ㅇ is still sorted by ㅇ, which comes after ㅆ and before ㅈ.
Where you will use the order
Most Korean dictionaries, printed and online, list entries in this order. Many Korean lists and indexes follow the same sequence too, so it is worth learning early.
A caution
Sources sometimes show slightly different orders, especially for the vowels, and some older books use a simpler sequence. Check which order your dictionary uses before you sort a list by hand.