Is your hardware locked with Optus or no?
If no, then you just need to configure the modem/router with PPPoE using your TPG username and password.
What type of NBN technology you have? Is it FTTN/B or HFC, FTTP, FTTC?
What troubleshooting have you tried so far?