They’re speaking of two different things.
“Be not afraid” refers to how we should live our faiths in the world openly, and not fear persecution or failure. Cf. the story of Pentecost in the Book of Acts, were the Holy Spirit imbued the apostles with a fiery courage to spread the Gospel.
What St. Paul is speaking of, is to not believe we can be assured of our own salvation: and to always carry with us a fear (awe, respect) of God as a way to remain humble.