This research revealed that the numbers of available heterocyclic compounds are mainly focused on nitrogen-containing compounds, such as quinazolines, indoles, benzimidazole, quinoxalines, coumarins, and pyrimidines, etc. A mixture of substituted aldehydes (0.01 mol) like acetylacetone (method 1) or ethyl acetoacetate (method 2), urea or thiourea (0.01 mol) and lemon juice (0.5 ml) were taken into a round bottom flask and reflux for 1 hour under continuous stirring. After completion of the reaction, the final product was recrystallized for purification. Simultaneously toxicity and anti-inflammatory activity were performed. But in case of using ethyl acetoacetate in method 2, the percentage yield was more as compared to using acetylacetone in method 1. So the derivatives obtained from method 2 were selected for further toxicity and anti-inflammatory activities.