My iPhone 5 keeps glitching and pressing buttons IIm not pressing?

So I've had this iPhone 5 for awhile now and I'm in no financial situation to buy a new one. The screen will completely glitch out and exit whichever app IIm in and go to the search on the home screen (the one used to search for apps and songs and stuff) and type random gibberish. It will also do this when I'm typing in the search or in a document. It will be working just fine then suddenly it will glitch out and type at random (it continues to do that as I type this so sorry if anything is spelled wrong but it is very hard to type. Sometimes Siri comes on as if I had been holdi g on the home button. My brightness is frequently changing and when I go to the control center while it is changing I can see the bar going back and forth. It is especially Anoying while watching YouTube. I will be on a video and It will completely close the video and open a new one on the playlist. The best way I can describe it is as if a ghost possesses my phone for short bursts at a time. I of course don't believe that but that s just to give you a picture.Is there anything I can do? I don't have a computer and I use my phone for all my homework.

Restart your phone.
if this not work, your phone has to been repaired

iF YOU WAN TO BUY ANY REPAIR PARTS, YOU CAN GO TO THE AMAOZN, HCQS