Herein, we report a convenient and facile methodology for the synthesis of new series of pyrazole and pyrimidine derivatives 2a–f and 3a–f under ultrasound irradiation. Pyrazole and pyrimidine derivatives have been synthesized in better yields and shorter reaction times compared with the conventional method. The chemical structures of all the synthesized compounds were elucidated by their IR, 1H NMR, 13C NMR, MS, and elemental analysis. Further, the target compounds were screened for their antimicrobial activity against four bacteria (Staphylococcus aureus, Bacillus subtilis, Escherichia coli, Pseudomonas aeruginosa) and two fungi (Candida albicans, Aspergillus niger). In particular, compounds 2a, 2d, 2e, 3a, 3e, and 3f exhibited potent antimicrobial activity.