@sarajk You can do it from the My Optus App. Click on Billing, Manage Direct Debit.
If you do it from My Account it looks like you would have to setup a new direct debit with new card details and cancel the old direct debit. Don't forget if you setup a new direct debit and the bill has already been issued you will need to pay that bill manually, then the direct debit will work for subsequent bills.
I am not an Optus employee. If a reply helps please give a Kudos and when an issue is solved please mark as solved.