The law requires that you have sufficient mental capacity to handle your own affairs. This includes making medical decisions for yourself and to entering into contracts for example.
To ensure that your affairs will be handled the way you want if you lose capacity, whether permanently or temporarily, you can prepare a power of attorney for finances. A durable power of attorney can be effective immediately and continue through your incapacity. You can also prepare a power of attorney that is effective upon your incapacity as determined by two medical doctors or the court.
You can also prepare a power of attorney for healthcare, which is now called an advance health care directive. This document allows you to appoint someone to make medical decisions for you in the event you are unable to do so.
If you prepare a revocable Living Trust, you can name a successor trustee to manage your trust assets in the event of your incapacity. Most people transfer title of their home into their trust so your successor trustee would be able to manage all aspects of your home for you.
If you have not made any arrangements such as I have described above, the court may appoint a conservator to act on your behalf. Nearly anyone can petition the court to become your conservator if they can show that you no longer have capacity to manage your affairs. I hope I don't have to say that this is the worst case scenario.