Welcome to Android Central! Which phone? Connecting a USB keyboard is a good idea, but you'd probably need an OTG adapter for that as well (which are cheap).
Or you can go to Google Play on any computer, log in with the account that's on the phone, then install a keyboard. It will install to the phone and if the Samsung keyboard app won't run, the newly-installed one may run instead (it depends on how the old one isn't running - there's more than one possibility).