After an Opponent files a Notice of Opposition, what must a Trade Mark Applicant do?

Yes, you can. You may provide a written request or file Form CM9 to withdraw your Trade Mark Application. [R 21A] You can file the form at our e-services portal, IP2SG. You would also need to inform the Opponent of the withdrawal.
Yes, he can ask the Registrar for such costs. However, the Registrar, in deciding whether to award costs in favour of the Opponent, will consider whether the opposition might have been avoided if the Opponent had given the Applicant reasonable notice before the notice of opposition was filed.
The Registrar is more likely to award the Opponent such costs if it had requested you to withdraw your Trade Mark Application (and you did not do so) before filing its notice of opposition. [R40] [Fourth schedule of the Trade Marks Rules]