@Al Imran Aslan , From your description, I know we didn't configure auto-enroll for this user in Intune. and get error "We Couldn't auto discover a management endpoint matching the username entered . Please check your user name & try again, if you know the URL to your management endpoint . Please enter it" when we do the enrollment via Window 10 access work or school. If there's any misunderstanding, feel free to let us know.
Firstly, we suggest to access Microsoft Endpoint Manager admin center->Devices->Enroll device->Automatic Enrollment, and check if the MDM URLs are there. If not, click "Restore default MDM URLs" to see if we can get the URLs.
Meanwhile, as a reminder, please ensure the user we enter to do the enrollment has Intune license assigned.
Hope it can help.
If the response is helpful, please click "Accept Answer" and upvote it.
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.