A raspberry pi is no different from any other computer.
The instructions are basically the same as for any linux machine.
If you want to save memory, you can skip all GUI things and do things from the command line. This means running the arduino-cli command line tool, which takes a bit of figuring out. The Makefile that comes with ProffieOS can show you some of the basics though.
For more musings on this topic, see this thread:
I’ve done a little bit of experimentation with this, but there is no ready-made solution at this time.