Have awake care.
This is both common and difficult.
The answer for any one person may be unique to them. The safest thing is to have 24/7 awake care. This can be impossible in a home setting. Make sure the person has an id bracelet on so that if they do get lost, someone can help return them to home. One can install alarms on the doors and windows. Call a local support group or your doctor for suggestions.