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:2:220

To this world and the Hereafter. And they ask you about orphans. Say, "Improvement for them is best. And if you mix your affairs with theirs - they are your brothers. And Allah knows the corrupter from the amender. And if Allah had willed, He could have put you in difficulty. Indeed, Allah is Exalted in Might and Wise.  

on, the matters of, this world and the Hereafter, and follow what is best for you in both. They will ask you about orphans, and the distress their affair caused them, for, if they became intimate with them, they may slip into error, but if they put aside the money due to them and prepare their meals for them separately, this would distress them. Say: ‘To set their affairs aright, in terms of their funds, by looking after it, and your mingling with them, is better’, than you not doing this; and if you intermix with them, your funds and theirs, they are your brothers, in religion and it is only natural for one to intermix his affair with his brother, so you do too; God knows well him who works corruption, in their property when he intermixes with them, from him who sets, it, aright, and God will requite both; and had He willed He would have harassed you, and made it difficult for you by prohibiting you from intermixing with them. Surely God is Mighty, victorious in His affair, Wise, in His actions.
القرآن:٢:٢٢٠

فِي الدُّنْيَا وَالْآخِرَةِ ۗ وَيَسْأَلُونَكَ عَنِ الْيَتَامَىٰ ۖ قُلْ إِصْلَاحٌ لَهُمْ خَيْرٌ ۖ وَإِنْ تُخَالِطُوهُمْ فَإِخْوَانُكُمْ ۚ وَاللَّهُ يَعْلَمُ الْمُفْسِدَ مِنَ الْمُصْلِحِ ۚ وَلَوْ شَاءَ اللَّهُ لَأَعْنَتَكُمْ ۚ إِنَّ اللَّهَ عَزِيزٌ حَكِيمٌ  

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