Purpose
A student's view of a course is different than an instructor's. Sometimes you need to see the student's perspective of the course to adjust your presentation of materials or test activities.
Procedure
There are two options.
"Switch role to"
In any course you're teaching, you can use the "Switch role to" function, found in the dropdown menu on the top right of every Moodle page, next to your user name and picture. This lets you easily jump back and forth from your view to the student's view.
"Log in as"
Log in as allows you to interact with a course and submit work as the student, not just see what they see. This function is only available in specific sandboxes.
Find the full written details here: