Here is a sensible, informed, and wise essay by Ali Minai at 3QuarksDaily that offers a clear picture of the general way AI systems like Chat-GPT work, and some sober recommendations for minimizing the disruptions they are likely to cause. His general conclusion:
The problem has to be addressed at least at three level: Regulation, engineering, and education. Regulation would control permissions, standards, rights, responsibilities, and accountability; engineering must focus on building systems that inherently pose smaller risks due to their design; and education must make human society more resilient to the potential harms of AI. None of these is likely to work perfectly, but their combination is the only way forward.