Some instructors might not allow any use of ChatGPT and others might allow only limited use.
If you are allowed to use ChatGPT 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 the use of generative AI: Acknowledging and Citing Generative AI in Academic Work.