Try which pg_resetwal
which pg_resetwal
It should give an o/p like so /usr/lib/postgresql/15/bin/pg_resetwal
/usr/lib/postgresql/15/bin/pg_resetwal
Change your user to su -l postgres, if not already
Execute command like so /usr/lib/postgresql/15/bin/pg_resetwal <path to pg data>
/usr/lib/postgresql/15/bin/pg_resetwal <path to pg data>