I have encountered this sentence:
Ich habe vorsichtig zu ergründen gesucht, wie er wirklich ist.
I understand the general meaning but what is "zu ergründen" doing? I need to understand how this sentence got built so I can do the same or something similar in the future. Please explain the structure of this sentence to me. Literal translation to English would help.