Installing Pybricks
To install Pybricks on your EV3, follow these instructions...
https://pybricks.com/ev3-micropython/startinstall.html
https://pybricks.com/ev3-micropython/startbrick.html
...and for Spike Prime...
https://pybricks.com/install/spike-mindstorms/
Writing and Running Programs
For the EV3, you will need to use Visual Studio Code (vscode) and install the EV3 MicroPython extension.
When writing programs for the Pybricks in vscode, you MUST create a new folder for your code, and "File -> Open Folder" from vscode.
You CANNOT just open the file alone. You MUST open a folder.
For the Spike, use Pybricks Code to program your device.