Chosen Solution
I have an iPhone 8 but this morning I connected it to the charger to charge while I was walking my dog when I come back my phone turned on like normal put said unlock your phone to use this accessory when i connected it with the cable that came with and an amazon USB adapter is it a glitch of should I get a new phone
I never heard of an iPhone not working with its original cable and charger, unless it’s broken. If you purchased it second hand you may have got non original nor Apple Mfi certified accessories, that would explain the message your phone is showing.