While updating to iOS 12, your iPhone may get into recovery mode or stuck on connect to iTunes logo for several reasons. This can happen during iOS 12 update, factory reset or wrong operation during jailbreak.
Install the latest version of iTunes, Open iTunes and click Help in the main menu > Select Check for Updates > Download the latest iTunes version
Follow the steps to get out of iTunes logo if you are stuck in Recovery Mode.
Hold the Home and Sleep/Wake buttons down together for a minimum of 10 seconds, or until the device turns off.
Push the Sleep/Wake button again to turn on your iPhone. If your iPhone is not in Recovery Mode, the problem is resolved. Otherwise, go to step 3
Launch iTunes and connect the iPhone to your computer. You will get a notification in iTunes saying that iTunes has detected an iPhone in Recovery Mode. Click on Ok.
Choose the device icon on the left side of iTunes window, and select the "Summary" tab.
Choose the "Restore" button.
After trying these steps, if you are still facing the issue, you can try some iOS repair tool to get your device back to normal when it is stuck in Recovery Mode.
It might also be helpful if your device is stuck in "Black Screen" or "Apple Logo".