Welcome to the Forum @Elena_Potoupa and thank you for reaching out!
What you are saying is correct. When you archive a Project, those tasks that were assigned to you will remain in your My Tasks. As it stands, there isn’t a feature to archive tasks but I would recommend you to have a look at the following thread where a few workarounds have been provided.
Additionally, there is a thread in the #productfeedback category regarding this topic: Option to exclude archived projects/tasks from search. You might want to upvote it!
Have a great day Elena!