One significant tool for addressing the concerns associated with the use of one of the applications in computer science is the law. Numerous laws and rules governing the use of computer science are designed to safeguard users, customers, and society at large. Law uses norms created by governmental and social institutions to control behavior. Programming is used to explore digital information in computer science. Computers got more potent and smaller as they evolved through generations, utilizing various technologies such as integrated circuits. Cyber law regulates online behavior and deals with matters pertaining to intellectual property, privacy, domain names, and other legal concerns. A few of the many concerns that the law must address in order to mitigate the electronic crimes are protecting privacy and security, upholding justice, limiting civil and criminal liability, ensuring safety, and controlling the application of AI in the workplace. Guidelines that people and organizations have to follow when utilizing computer science applications, making sure that these requirements are met in full. Additionally, as companies must commit to recording AI usage procedures and making clear the use of data and algorithms, the regulation fosters accountability and openness. By doing this, the possibility of prejudice and mistakes when utilizing AI is decreased. This survey provides a self-contained introduction to cybercrimes and types of cybercrimes. We also present ways to combat cybercrime and limit its spread.