From time to time you will find yourself in such a bad position that the best thing you can do is to just pick the cue ball up and hand it to your opponent. For example when you are hooked with a very low chance of making a good hit, especially if making the good hit would still help out your opponent by breaking out their balls or clearing yours away from a pocket. In fact, it may still be a good idea even if you aren't hooked but even attempting a good hit would likely result in a better position for your opponent. In order to make this decision, you should look at it from your opponent's perspective and gauge how excited you'd be to have ball-in-hand as it sits verses what the table might look like if you indeed try for a good hit and end up breaking things out while possibly giving them ball-in-hand anyways. This thought process is also useful when you are trying to hit or even make your ball because it may show you that you need to hit it a certain way or take a different shot in order to leave the table to your advantage.
If you find yourself in the position where you are about to hand over the cue ball you should first take a look around and see if there is a way for you to safely tie up some of your opponents balls in some way since you will be giving up ball-in-hand anyways. You could purposely hit one of your opponent's balls near another one, preferably one that is close to the rail. Another option is to hit the 8ball first to block a pocket where your opponent has a ball on the rail. Just make sure that whatever you do, don't break up existing clusters of your opponent's balls. If they have one trouble spot, they can likely get out of it with the ball-in-hand, so creating a second trouble spot for them can make all the difference. Be creative, the normal rules don't apply since the alternative is a foul anyways.
I had an APA match about a year ago that I vividly remember. I was down early and needed to win three games in a row. My opponent broke and I ran the table. I then had a break-and-run to bring us to the case game. I was working on my second break-and-run in a row when I got out of position and totally hooked myself on the ball before the eight. I went through the decision making process outlined above and decided that I didn't like the crazy kick shot that was in front of me. I felt that I had a better chance of winning if I clustered some of his balls and got another chance at the table. I ended up hitting one of his stripes toward another stripe and giving him ball-in-hand. He did the reverse of this and used his ball-in-hand to break up one of his clusters and leave me hooked. I pushed another stripe to create another cluster for him. This went back and forth for a few shots until he finally let me see a sliver of my only solid. It wasn't an easy shot by any means, so I considered making another cluster for him but since I had already created a few trouble spots for him, I ended up cutting my ball all the way down giving myself a great shot at the 8ball. It wasn't quick and it wasn't pretty, but it made all the difference between a win and a loss.