usually, you can write like this, 硬い石(いし)、硬い文章(ぶんしょう)、硬い表情(ひょうじょう)、堅い木(き)、など。堅い and 固いare usually used with things like belief, determination, defense, foundation, etc. and as a matter of fact, japanese people sometimes connect 固い and 堅い with the same subjects.
so if you're not sure, why not just use かたい?quite a few japanese people are doing like this when they write!