It is absolutely necessary that you drink the medicine before sleeping.
Wait at least 2-3 hours after your meal before sleeping.