I need to enter lock code without the bottom of the touch screen as it's not responding

The bottom of my screen and the three buttons underneath are not responding. I was going to try a hard reset but I want to back up my phone first.
Problem is I can’t enter my code without having the bottom of the screen for numbers and to press return. Any ideas how I can enter my code? Is there a way of getting it to rotate?
Thanks

If you mean the pin code, which unlocks the SIM card, just remove the SIM card from your phone.