You are here beacuse certainly you have executed :
Solution 1:
yarn encore dev
and you got :error Command "encore" not found.
maybe yarn in not installed so you should execute
> yarn install
then for example the next command to build assets
> yarn encore dev
Solution 2:
updating (/upgrading) yarn may be your solution also so you should apply:
> yarn upgrade
> yarn add yarn
Please let me know in comments if i helped to resolve your problem.