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:23:115

Then did you think that We created you uselessly and that to Us you would not be returned?"  

Did you suppose that We created you aimlessly, and not for an underlying reason, and that you would not be returned to Us?’ (read active tarji‘ūna, ‘you ˹would not˺ return’, or passive turja‘ūna, ‘you ˹would not˺ be returned’) Nay! But ˹it was˺ so that We might enthral you with commands and prohibitions, where after you would be returned to Us for Us to requite ˹you˺ accordingly: And I did not create the jinn and mankind except that they may worship Me ˹Q. 51:56˺.
القرآن:٢٣:١١٥

أَفَحَسِبْتُمْ أَنَّمَا خَلَقْنَاكُمْ عَبَثًا وَأَنَّكُمْ إِلَيْنَا لَا تُرْجَعُونَ  

{أفحسبتم أنما خلقناكم عبثا} لا لحكمة {وأنكم إلينا لا ترجعون} بالبناء للفاعل وللمفعول؟ لا بل لنتعبدكم بالأمر والنهي ترجعوا إلينا ونجازي على ذلك (وما خلقت الجن والإنس إلا ليعبدون).