Depending on the type of X-ray, fasting may not be necessary. However, if contrast material is used, you may need to avoid eating or drinking for a certain period before the procedure