Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:5:67

O Messenger, announce that which has been revealed to you from your Lord, and if you do not, then you have not conveyed His message. And Allah will protect you from the people. Indeed, Allah does not guide the disbelieving people.  

O Messenger, make known, all of, that which has been revealed to you from your Lord, and do not conceal any of it out of fear that you may suffer some harm; for if you do not, that is, if you do not make known all of what has been revealed to you, you will not have conveyed His Message (risālatahu, or read plural, risālātihi, ‘His Messages’) since to conceal some of it is to conceal it all. God will protect you from people, who may try to kill you. The Prophet (s) used to have guards up until ˹the time that˺ this ˹verse˺ was revealed, then he said, ‘Depart, for God protects me now’, as reported by al-Hākim. God does not guide the unbelieving folk.
القرآن:٥:٦٧

يَا أَيُّهَا الرَّسُولُ بَلِّغْ مَا أُنْزِلَ إِلَيْكَ مِنْ رَبِّكَ ۖ وَإِنْ لَمْ تَفْعَلْ فَمَا بَلَّغْتَ رِسَالَتَهُ ۚ وَاللَّهُ يَعْصِمُكَ مِنَ النَّاسِ ۗ إِنَّ اللَّهَ لَا يَهْدِي الْقَوْمَ الْكَافِرِينَ  

(يا أيها الرسول بلغ) جميع (ما أنزل إليك من ربك) ولا تكتم شيئا منه خوفا أن تنال بمكروه (وإن لم تفعل) أي لم تبلغ جميع ما أنزل إليك (فما بلغت رسالته) بالإفراد والجمع لأن كتمان بعضها ككتمان كلها (والله يعصمك من الناس) أن يقتلوك وكان ﷺ يحرس حتى نزلت فقال: "" انصرفوا فقد عصمني الله "" رواه الحاكم (إن الله لا يهدي القوم الكافرين).

See similar narrations below:

Collected by Bukhārī
bukhari:7531Muḥammad b. Yūsuf > Sufyān > Ismāʿīl > al-Shaʿbī > Masrūq > ʿĀʾishah > Man Ḥaddathak > Muḥammad ﷺ Katam Shayʾ > Muḥammad > Abū ʿĀmir al-ʿAqadī > Shuʿbah > Ismāʿīl b. Abū Khālid > al-Shaʿbī > Masrūq > ʿĀʾishah > Man Ḥaddathak

Whoever tells you that the Prophet ﷺ concealed something of the Divine Inspiration, do not believe him, for Allah said: 'O Apostle Muhammad! Proclaim (the Message) which has been sent down to you from your Lord, and if you do it not, then you have not conveyed His Message.' (5.67)  

البخاري:٧٥٣١حَدَّثَنَا مُحَمَّدُ بْنُ يُوسُفَ حَدَّثَنَا سُفْيَانُ عَنْ إِسْمَاعِيلَ عَنِ الشَّعْبِيِّ عَنْ مَسْرُوقٍ عَنْ عَائِشَةَ ؓ قَالَتْ مَنْ حَدَّثَكَ أَنَّ مُحَمَّدًا ﷺ كَتَمَ شَيْئًا وَقَالَ مُحَمَّدٌ حَدَّثَنَا أَبُو عَامِرٍ الْعَقَدِيُّ حَدَّثَنَا شُعْبَةُ عَنْ إِسْمَاعِيلَ بْنِ أَبِي خَالِدٍ عَنِ الشَّعْبِيِّ عَنْ مَسْرُوقٍ عَنْ عَائِشَةَ قَالَتْ مَنْ حَدَّثَكَ

أَنَّ النَّبِيَّ ﷺ كَتَمَ شَيْئًا مِنَ الْوَحْىِ فَلاَ تُصَدِّقْهُ إِنَّ اللَّهَ تَعَالَى يَقُولُ {يَا أَيُّهَا الرَّسُولُ بَلِّغْ مَا أُنْزِلَ إِلَيْكَ مِنْ رَبِّكَ وَإِنْ لَمْ تَفْعَلْ فَمَا بَلَّغْتَ رِسَالَتَهُ}