@Siya Kumari, Thanks for posting in Q&A. To remove user from the local cache on a shared iPad device, we can try the "Remove user" action. The iPad device must be set up to manage the iOS/iPadOS Classroom app by using an iOS/iPadOS education profile. Here is a link with more details:
https://learn.microsoft.com/en-us/mem/intune/remote-actions/device-remove-user#remove-a-user
Hope the above information can help.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.