هذا is a masculine demonstrative pronoun meaning “this”.ما هذ؟ means “What is this?”. هذا طالبٌ means “This is a student”. هذا is the subject of the sentence but it is not a word that has case.
ذلِكَ is a masculine demonstrative pronoun meaning “that”. As in English, ذلك “that” refers to objects which are more distant or is used in contrast: هذا طالبٌ وذلك مُدَرِّسٌ
هذه and تلك are the feminine equivalents for هذا and ذلك
Whenever any of these four words is followed by a definite noun we have one unit meaning “this noun”. For example هذا الكتابُ means “this book” and ذلك البليدُ means “that moron”. (These are phrases, not sentences. Note that all four demonstratives end in a vowel, so no helping vowel is needed for elision.) Also, be aware that phrases such as هذا الكتابُ do not mean “This is the book” but only “this book”. These phrases often serve as the subject of an equational sentence as in: هذا الطالب جميلٌ “This student is handsome.”