OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... as much data as possible
OctoPrint Ver 1.7.0, OctoPi Ver 0.18.0 on RPi 4B Rev 1.2, Creality Ender 3v2 on Stock Firmware, OS X operating system running Safari and Brave to access via browser.
You don't say if you can ssh into the PI
If so, then login to the Pi as the pi user and run the raspi-config command and select System Options, there, you will find an option to change hostname.
raspi-config has to be run as root so:
sudo raspi-config
Reboot the system after the change.
If for some reason you can't ssh into the pi, then you'll have to connect a mnitor and keybord to login.
I was really hoping nobody would make me admit it, but I was using the wrong password to log into the pi via SSH.
I had assumed since I was trying to edit a pi that was already configured otherwise that the password for SSH would be the same as the one I use to log into my OctoPrint instance.