If the child decides not to pursue post-secondary education, you can designate a replacement beneficiary or transfer the funds to another RESP. Under certain conditions, you could keep some or all of the grants in the RESP.
Otherwise, you'll have to close the RESP and pay back the grants. You'll then get your contributions and investment income back. You can add this money to your income and pay a special tax on it, or use it to contribute to your RRSP.