Introduction Preoperative anxiety can prolong the induction of anesthesia and postoperative recovery, increase the risk of postoperative delirium, increase pain, and increase analgesic use. Pharmacological interventions are associated with increased cost to the hospital, potential surgical delay while waiting for the medication to take effect, and delayed discharge from the recovery room, while nonpharmacological modalities, including electronic gadgets, are cost-effective, noninvasive, and carry a low risk for adverse effects. This study aimed to compare pharmacological and nonpharmacological interventions (use of technology) for alleviating preoperative anxiety in children undergoing general anesthesia in Pakistan. We hypothesize that digital distraction will reduce preoperative anxiety more effectively than oral midazolam. Methods A randomized controlled trial was conducted on 106 children scheduled for elective surgery. Written informed consent was obtained from the patient/next of kin. Patients were assigned to one of two groups by a computerized list. The control group received oral midazolam 0.5 mg/kg at least 30 minutes before surgery, and the interventional group was distracted by using digital devices (tablets). Children's perioperative anxiety was assessed using the Modified Yale Preoperative Assessment Scale in the preoperative holding area and the OR just before induction, with higher scores showing more anxiety. The Shapiro-Wilk test was applied to examine the normality of average scores at preop and inside the OR. The Mann-Whitney U test was used to compare the control and interventional groups. Results The analysis included a total of 106 pediatric patients. The primary endpoint, measured by anxiety levels using the Yale Preoperative Anxiety Scale, was compared between the two groups in the preoperative holding area and just before induction. In the holding area, the median scores were 46.67 (IQR 26.6) for Group A and 28.33 (IQR 23.33) for Group B. Just before induction, the median scores were 46.67 (IQR 27.50) for Group A and 23.33 (IQR 10.0) for Group B. The maximum preoperative scores were 70.0 (median 46.67, IQR 26.67) in Group A and 78.33 (median 28.33, IQR 23.33) in Group B. At induction, Group A had a maximum score of 68.33 (median 46.67, IQR 27.50), while Group B had a maximum score of 55.0 (median 23.33, IQR 10.0). Conclusion The results indicate that distraction techniques can be considered an alternative to traditional pharmacological premedication for children undergoing elective surgery.