Viagra can be taken with or without food, but it is recommended to avoid consuming high-fat meals before taking the medication as it may delay its effects.