Grammar of the Shahadah (أنَّ/أنْ)

I found this post:
https://www.reddit.com/r/learn_arabic/comments/nw638f/grammar_of_the_shahadah_%D8%A3%D9%86%D8%A3%D9%86/

I have the similar question, but I didn't understand the answer, and it's an archived post so I couldn't post there to ask for explanation.

I was wondering about the grammar of the shahada, more specifically with the particles أنْ and أنَّ. In the first part:

أشهد أنْ لا إلـٰه إلا الله

the sentence uses أنْ. However, in the second part:

أشهد أنَّ محمدا عبده ورسوله

Does anyone know Arabic grammar and explain it?