1. Talk about it ahead of time
I realize you can't possibly prepare for everything your child is ever going to do wrong but that shouldn't stop
2. Don't back down
This applies to every consequence you're ever going to enforce but is particularly true regarding cell phones and tablets. If you let your child talk you out of it just once they'll argue with you about it endlessly from that point forward. Don't set the precedent that a phone being taken away is negotiable. If you do, invest in a yoga mat. That way you'll have a comfortable place to sit while your child argues with you for the rest of the night every time you try to enforce the rule.
3. Empower them to get it back
You're not a judge and your living room isn't a courtroom. Don't sentence your kids to an arbitrary amount of time that their punishments will last. For example, when you ground a kid for a week, what have you done? Enforced a rule? Sure. Done your job as a parent? Absolutely. But what else? You've signed up for a week of an annoying teenage martyr in your living room who won't shut up about how terrible her life is.
Instead, set an expectation. For example, instead of taking a kids phone away for a day, take it away until they can go 24 hours without asking about it, arguing, or sulking. Now it's up to them. Take it away until they do specific tasks you want. Or hey, combine the two. Take the phone away until they can go 2 days where they knock out everything on their to-do list. The point is, don't put them in a situation where they can sit around and be annoying for a few days and then get their stuff back. Remember, you're not teaching them how to be inmates. You're teaching them how to be proactive in correcting their mistakes. This is a great opportunity for that.
4. Time off for good behavior
Here's what I mean.... you've set the expectation that all phones are off and in a parents hand no later than 10pm. Good rule. So when your son hands you his phone at 10:30, you're in a bit of a situation. You've discussed this already and he's aware that not turning your phone in by the designated time will result in losing it for 48 hours. But, you're going to stick a caveat on that consequence. If he hands it over peacefully and doesn't ask to have it back or complain about it, you'll generously agree to cut that punishment down to 24 hours. The consequence is still in place and he's still not happy about giving up his phone but at least now there's a reason for him to not go all nutso about it.