Background The appropriate disposal of medication is a well-recognized issue that has convened growing recognition in several contexts. Insufficient awareness relating to appropriate methods for the disposal of unneeded medicine may result in notable consequences. The current research was conducted among the public in Iraq with the aim of examining their knowledge, attitude, and practices regarding the proper disposal of unused and expired medicines. Methods The present study used an observational cross-sectional design that was community-based. The data were obtained from using an online questionnaire. The study sample included people of diverse genders, regardless of their race or occupational status. The study mandated that all participants meet two criteria: firstly, they had to be a minimum of 18 years old, and secondly, they needed to have permanent residency status in Iraq. Results The research population consisted of 591 participants from general population. The majority of participants were men (64.8%) with average age of 33.5±9.1 years. The majority of participants (˃50%) answered four out of eight knowledge questions correctly. There were significant (P-value ˂0.05) differences in four knowledge items about disposing of unused/expired medications according to the educational level. Elder participants had significantly higher knowledge about the disposing of unused/expired medications compared to younger ones. More than 84% correctly agreed that improper disposal of unused and expired medication has adverse effects on environment. Although the majority of the participants had positive attitude toward the safe disposal of unused/expired medications, their actual practice was improper for these medications. Approximately 70% of the participants have disposed unused/expired medications into their home trash can. Conclusion Despite increasing awareness from the general populace about the possible harm and substantial hazards linked to expired medicines, there is an absence of understanding concerning the proper techniques for disposing of and managing these prescriptions.