I think what you are seeing most likely is a well-known gmail scam. See How a Gmail password stealing scam works https://us.norton.com/internetsecurity-emerging-threats-how-a-gmail-password-stealing-scam-works.html
If you gave you Apple ID password to a scammer, then
Change your Apple ID password https://support.apple.com/en-us/HT201355
Here is What to do [before] or after you change your Apple ID or password https://support.apple.com/en-us/HT204071
Increase/learn about security
See If you think your Apple ID has been compromised https://support.apple.com/en-us/HT204145
Increase the Security of your Apple ID https://support.apple.com/en-us/HT201303
iCloud security overview https://support.apple.com/en-us/HT202303
Ways to keep your information safe on Mac https://support.apple.com/en-gb/guide/mac-help/mh11402/mac
Information on Phishing, etc.
See If you see apple.com/bill, itunes.com/bill, or an unfamiliar charge on your statement https://support.apple.com/en-us/HT201382
See Identify legitimate emails from the App Store or iTunes Store https://support.apple.com/en-us/HT201679
See How to avoid scams when using Apple Pay to send and receive money https://support.apple.com/en-us/HT208226
For scam related information from Apple including reporting scams to Apple see Avoid phishing emails, fake 'virus' alerts, phony support calls, and other scams https://support.apple.com/en-us/HT204759