Hello elize178,
Thank you for using Apple Support Communities!
We understand from your post that the keyboard on your iPhone doesn't always show up on the screen when you need to type. Are you using the original keyboard or a 3rd party keyboard? If you could be using a 3rd party keyboard, remove the keyboard using the steps in this article under the heading, "Add or delete a third-party keyboard app", then restart your iPhone and test it again.
About the keyboards settings on your iPhone, iPad, and iPod touch - Apple Support
Best Regards.