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:4:6

And test the orphans ˹in their abilities˺ until they reach marriageable age. Then if you perceive in them sound judgement, release their property to them. And do not consume it excessively and quickly, ˹anticipating˺ that they will grow up. And whoever, ˹when acting as guardian˺, is self-sufficient should refrain ˹from taking a fee˺; and whoever is poor - let him take according to what is acceptable. Then when you release their property to them, bring witnesses upon them. And sufficient is Allah as Accountant.  

Try, test, well the orphans, before reaching maturity with regard ˹the duties of˺ religion and ˹before˺ they can ˹legally˺ manage their own affairs, until they reach the age of marrying, that is, until they have become eligible for it through puberty or ˹legal˺ age, which, according to al-Shāfi‘ī, is the completion of fifteen years; then, if you perceive in them maturity, that is, right ˹judgement˺ in matters of religion and their property, deliver their property to them; consume it not, O guardians, wastefully, without due merit, and in haste, that is, hastening to expend it, fearing, lest they should grow up, and become mature, at which time you will be obliged to hand it over to them. If any man, who is a guardian, is rich, let him be abstinent, that is, let him abstain from the orphan’s property and refrain from consuming it; if he is poor, let him consume, of it, honourably, that is, in line with the wage for his work. And when you deliver to them, the orphans, their property, take witnesses over them, that they have received it and that you are absolved ˹of the obligation˺, so that if any dispute occurs, you are able to refer to a clear proof: this is a command ˹intended˺ for guidance. God suffices as a reckoner, as a guardian of His creatures’ deeds and as a reckoner of these ˹deeds˺ (the bā’ ˹in bi’Llāhi˺ is extra).
القرآن:٤:٦

وَابْتَلُوا الْيَتَامَىٰ حَتَّىٰ إِذَا بَلَغُوا النِّكَاحَ فَإِنْ آنَسْتُمْ مِنْهُمْ رُشْدًا فَادْفَعُوا إِلَيْهِمْ أَمْوَالَهُمْ ۖ وَلَا تَأْكُلُوهَا إِسْرَافًا وَبِدَارًا أَنْ يَكْبَرُوا ۚ وَمَنْ كَانَ غَنِيًّا فَلْيَسْتَعْفِفْ ۖ وَمَنْ كَانَ فَقِيرًا فَلْيَأْكُلْ بِالْمَعْرُوفِ ۚ فَإِذَا دَفَعْتُمْ إِلَيْهِمْ أَمْوَالَهُمْ فَأَشْهِدُوا عَلَيْهِمْ ۚ وَكَفَىٰ بِاللَّهِ حَسِيبًا  

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