I can only access my printer remotely when I am on the same network with the Rasberry Pi. I am very new to this and have no idea what to try and fix this. the pi is connected to a WiFi network and like I said when I am on the same network as the Pi remote works perfectly.
OctoPrint is meant to be accessed from inside a network. But here are solutions: A Guide To Safe Remote Access of OctoPrint
I must have missed that when I was setting up Octoprint. the guide you requested was exactly what I needed. Thank you for you help.