Remember to check with your instructor about their individual policy regarding use of AI for assignments. Some instructors might not allow any use of generative AI and others might allow only limited use. If you are allowed to use AI in an academic assignment, here are some guidelines for citing.
Your instructor may also ask for an appendix that includes the prompts that you provided to ChatGPT or the full transcript of your interaction.
See also this summary of ways to acknowledge use of generative AI: Acknowledging and Citing Generative AI in Academic Work.
It's also worth reading this advice, since some uses don't fit the standard way of citing: