On a boat, tell the capt or Divemaster your situation, and experience level, typically they'll find you someone who is reasonably compatible, that was my experience.
Also, don't be a newbie-seeks-instabuddy on a difficult, exotic, or expensive dive, since the more experienced divers want the full "Cadillac" experience without air time or attention limits from a new diver. Choose instead a nice ordinary "Chevy" dive where their level of "pay-it-forward, it's-good-for-the-sport, hell I was a newbie once and kind people helped me"-type charity will be much higher. This will pretty much happen naturally since as a newbie you won't tend go be on those rare, expensive dive locations anyway, nor do you need that much challenge and thrill yet anyway.
Be honest, that's the main thing. Divers are more than willing to help someone who asks, but distrust someone who bull****s them.