The term "artificial intelligence" (AI) refers to technology becoming increasingly prevalent in many facets of human life. Nevertheless, significant concerns regarding social justice and privacy in the application of AI are also being noticed. This article explores the significance of ethics in developing artificial intelligence systems that can protect individuals' privacy and promote social justice. A qualitative methodology was used for this study, which consists of a review of previous research. As a result of this research, we describe what is artificial intelligence with examples of its use, ethics with its functions, how to embed ethics into artificial intelligence technologies, including robot and machine ethics. The following is an examination of AI and ethics from the point of view of privacy and social justice. In the context of the use of AI, offer some suggestions about constructing a more moral and accountable AI system.