Look at the section Add text in a text box at the link Add and replace text in Pages on iPad - Apple Support. That clarifies how one adds a text box to a document.
Your magic keyboard for the 4th gen iPad Pro needs to dock correctly to remain charged. Separate and then reconnect the iPad Pro, and then confirm that the iPad Pro is fully charged which will also charge the keyboard when attached. If at any time in the past, you spilled liquid on that keyboard, it may be failing and you need to contact Apple Support, AppleCare, or schedule time at an Apple Store or Authorized Service Provider to have it evaluated for damage.