Revive your unresponsive iPhone by forcing it to restart. Additionally, you can try charging the phone or reinstalling iOS.
To unlock your iPhone from its carrier, you'll likely need to contact your carrier directly to cancel your contract.