Look here for the docs:
https://frappeframework.com/docs/user/en/api/database
in your case, you would do
users = frappe.get_all("User")
or
users = frappe.get_list("User")
Look at the docs, there are many options you can add there.
Check also this recent thread, if you are looking for a particular value.