macOS equivalent of locate: mdfind. This actually uses Spotlight, so it can search for files by content as well as by name.
# search by content:
$ mdfind some_string
# search by name:
$ mdfind -name my_file.txt
Both commands return a list of files matching the query.