The P2Y6 receptor (P2Y6R), as a crucial member of the purine family, is a potential therapeutic target for the treatment of intestinal inflammation, tracheal inflammation and diabetes. We first discovered the hit compound (5a, IC50 = 168.5 nM against P2Y6R) through our in-house library screening. Then, further medicinal chemistry efforts were made to optimize compound 5a, and a potent P2Y6R antagonist (5 ab) with better antagonistic activity (IC50 = 19.6 nM) was obtained. The molecular docking, CETSA, SPR and pull-down results indicated that compound 5 ab displayed strong binding to P2Y6R. Also, compound 5 ab possessed high selectivity and satisfying oral bioactivity and pharmacokinetic profiles. In experiments with LPS-induced acute lung injury in mice, after treatment with compound 5 ab, the level of inflammatory factors IL-6, TNF-α and IL-β were considerably decreased, the infiltration of immune cells was decreased. Further exploration revealed that 5 ab inhibited the expression and release of chemokines in lung tissue, suppressing the activation of the NLRP3 inflammasome. Compound 5 ab had certain anti-inflammatory abilities in vivo and in vitro. These results demonstrate that compound 5 ab is a potential P2Y6R antagonist and is worthy of further study.