How can I distinguish 地 in different words
Your example is a kind of special.

Strictly speaking, “小心地滑” is intrinsically ambiguous. It can be interpreted in two different ways: “caution slippery floor” (where 地 is floor) and “slip carefully” (where 地 is the structural particle for adverbial phrase, the same as the 地 in 慢慢地走). Without any context, they both make perfect sense. There are some jokes that make use that ambiguity.

It is the everyday life experience that let the Chinese people know, that when 小心地滑 appears on a sign on a floor, it means “caution slippery floor”, but not the other.

So, based on grammar only, you cannot distinguish the two. 小心地滑 is ambiguous, and the 地 in the two words can be interpreted in the same way. You need context (not only context from text, but also environment, etc.) to distinguish the two meanings of 小心地滑.

By the way, 小心地滑 is not ambiguous in speech, as the two meanings have different pronunciation.