How to create Authentication and generate access token for REST API

I am using REST API, But when I log in It gives an error
“message”: “Incomplete login details”,
“exc_type”: “DoesNotExistError”,
“exception”: “frappe.exceptions.AuthenticationError”

You hav to pass token in api header