There are two ways through which you can create a legal document as a proof of the money borrowed, when it should be returns and various other conditions.
PROMISSORY NOTE (or)
A Promissory note is a legally written promise to pay a debt at a fixed time, a determinable future time, or on demand of the payee, subject to certain onditions. It is a financial instrument, in which one party promises in writing to pay a determinate sum of money to the oher at a time mentioned in the Promissory note. This instrument comes under Section 4 of the Negotiable Instruments Act, 1881, and has to be signed by the borrower.
While a Loan Agreement (or a Loan Contract) acknowledges that there is a loan, specific promise to pay and also states that the lender has a right ti recourse.