Hi and Welcome. My Name is ***** ***** I look forward to assisting you today with your question.
There are two reasons for this problem. Either your Apple ID is hacked and someone else is using your Apple ID on his/her Mac. This way he/she can access the stuffs stored on your iCloud like photos, messages, logs etc
Or these are scam or phishing messages/emails. There are many scams out there which makes you think that these are official mails and when you click on the link on these messages to change your password, they actually get your ID and info when you try to reset through their links.
So ignore those messages and delete them. Then I want you to change your Apple ID password ***** Apple's official website.
Go to this website --> https://iforgot.apple.com/
Then reset your Apple ID password. Once you didn't that, I want you to enable two factory authentication. This way, no one else will be able to have unauthorized access to your Apple ID. Follow the instructions in here to enable two factory authentication --> https://support.apple.com/en-in/HT204915
You account will be secure once you did the above two. Again, you must reset through the above official websites. DO NOT follow any websites or link you see on the messages you received.
If you have any questions or would like any additional information, please don't hesitate to ask