Your anesthesiologist will make the decision based on your medical history, usually 10-12 hours before the surgery.
My first surgery (top) was scheduled at noon, and I was told not to eat or drink after 12 am. My second surgery (hysto) was scheduled at 9 am, and I was told that I could eat solid foods until 3 am and drink clear liquid until 6 am.
You can ask your doctor to give you something to help with your anxiety before the surgery, and on your day of surgery, if you feel very uncomfortable, you can call the surgery center to get you into prep early so you can receive IV fluid and medication to help with your anxiety.