(1) Simply install the LTS version of Node.js instead of the current/latest; that alone will solve any problems.
(2) If you want to use the newest version of Node here's what you can do:
install an extra package from npm with this command:
npm install cross-env
Then, adjust your "start" and/or "dev" script in your package.json file to instead be this:
"start": "cross-env NODE_OPTIONS=--openssl-legacy-provider wp-scripts start"