There is indeed a similar, maybe even same, trash that works on MacOS and available on brew. Users are covered there too.
Similar, rm-safely is just a simple shell function though. you don't need to really install another specialty command, just copy over rm() function put them in your shell rc.