Just to lead off this post, this is a big part of why I tackle lettering pretty much in full during the thumbnail process of my comic- I've been burned way too hard in past projects by just guesstimating how much space everything will take up and running too low on space or having awkward positioning/cover ups as a result
I try not to write off on a panel composition until all of the speech bubbles are comfortably and accurately located.
That said, I do a lot of the same methods that other people have mentioned. Some work out pretty cleanly, others... end up being awkward even if you're careful about it lol. Here are some recent panels that I've done with some speech bubble gymnastics going on:
I'm a big fan of those thin lines that connect multiple speech bubbles by the same speaker which can allow you to space them apart more but still make sense. Also reduces the amount of tails you need. This one also has a chibi pop in like others have talked about. I sometimes do the little chibi heads as well!
This one was rough and really relies on the left-to-right reading order to work. It's not as clear as it could be but I hope it makes enough sense as-is @u@;; This was one where I tried out a few different compositions/angles for the top panel and settled on this one because it allowed for the bubbles to be close enough to the corresponding characters to work out okay. I also like those thin connecting lines to connect between panels sometimes!
This one is a little sketch with no tails or other indicators other than the fact that it's continuing a coversation from the previous panel... I may edit this before I post tbh LOL. Basically though the left/right relationship of the characters and their speech bubbles was establsihed in the prior panel and it's fairly obvious who is saying what with context but... chibi heads may be in order.
Last example. The upper panel here is another kinda sketchy example. The 2nd bubble doesn't fit well in the composition but I wasn't sure where else to put it so I just used a really long tail @u@;; I like the little overlap thing in the lower panel tho!