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:58:12

O you who have believed, when you ˹wish to˺ privately consult the Messenger, present before your consultation a charity. That is better for you and purer. But if you find not ˹the means˺ - then indeed, Allah is Forgiving and Merciful.  

O you who believe, when you converse in secret with the Messenger, when you wish to converse with him privately, offer some voluntary alms before your secret talk. That is better for you and purer, for your sins. But if you find nothing, to offer as alms, then God is indeed Forgiving, of your secret conversation, Merciful, to you. In other words: nothing will be held against you for holding a secret conversation without having offered some voluntary alms ˹beforehand˺. However, He ˹God˺ abrogated this later by saying:
القرآن:٥٨:١٢

يَا أَيُّهَا الَّذِينَ آمَنُوا إِذَا نَاجَيْتُمُ الرَّسُولَ فَقَدِّمُوا بَيْنَ يَدَيْ نَجْوَاكُمْ صَدَقَةً ۚ ذَٰلِكَ خَيْرٌ لَكُمْ وَأَطْهَرُ ۚ فَإِنْ لَمْ تَجِدُوا فَإِنَّ اللَّهَ غَفُورٌ رَحِيمٌ  

{يا أيها الذين آمنوا إذا ناجيتم الرسول} أردتم مناجاته {فقدموا بين يدي نجواكم} قبلها {صدقة ذلك خير لكم وأطهر} لذنوبكم {فإن لم تجدوا} ما تتصدقون به {فإن الله غفور} لمناجاتكم {رحيم} بكم، يعني فلا عليكم في المناجاة من غير صدقة، ثم نسخ ذلك بقوله.