Both 突然 (tūrán) and 忽然 (hūrán) express the something happens in a very short time or is unexpected. Both can be translated as "unexpectedly" or "surprisingly", however, 突然 is a bit harsher in tone while 忽然 is a bit softer. Also, their grammatical features are subtly different, as outlined in this article.

Both 突然 and 忽然 can be used as Adverbs
突然 and 忽然 both can put in the sentence as adverbs or adjectives, just make sure to put them before the verb or the adjective!
Before a Verb

Examples

Shuì jiào de shí hou , wǒ de diàn huà tū rán xiǎnɡ le .
睡觉 的 时候,我 的 电话突然 响了。
While I was sleeping, my phone suddenly started to ring.

Before an Adjective

Examples
天 突然 暗 了。(Tiān tū rán àn le 。 )
天 忽然 暗 了。(Tiān hū rán àn le 。)
The sky suddenly got dark.

At the Beginning of a Sentence

You can place 突然 and 忽然 at the beginning of a sentence, just make sure to add a comma after it!
Structure

Examples
突然,他 进来 了。(Tū rán , tā jìn lái le 。 )
忽然,他 进来 了。(Hū rán , tā jìn lái le 。 )
Suddenly, he entered.

突然 can be used as an Adjective

突然 can be used as an adjective (directly modifying nouns), while 忽然 cannot.

Structure as an Adjective

Examples

Zhè shì yī chǎnɡ tū rán shì ɡù , wǒ men dōu méi xiǎnɡ dào.
这 是 一 场 突然 事故,我们 都 没 想 到。
This was a sudden accident. None of us thought it could happen.

突然 can be used as a complement

突然 as an adjective can also be sued as a complement (called 补语 in Chinese). 忽然 cannot be used as a complement.
Structure for verb and complement

Examples

Shì qínɡ fā shēnɡ dé tài tū rán , wǒ men bú zhī dào zěn me bàn 。
事情 发生 得 太 突然,我们 不 知道 怎么 办。
Things happened so suddenly, we didn't know what to do.

突然 can be used as the predicate

Just like other adjectives, 突然 can be used as the predicate of a sentence. It is usually added with a modifier like 很, 非常, 不 etc. It can also end with 得很, 得多, 极了, etc. complements.

Structure with modifier + 突然
Examples

Zhè ɡè jué dìnɡ tài tū rán le.
这 个 决定 太 突然 了。
This decision was too sudden.

Structure with 突然 + modifier

Examples

Lí kāi shànɡ hǎi tū rán dé hěn.
离开 上海 突然 得 很。
Leaving Shanghai is really surprising.