I'd say broadly that the right first step is to communicate with the maintainers somehow. Figuring out how is part of it. Check for activity - how many PRs, open and closed, does the project have? How often do they come in, and how quickly do they get commented on or merged by project maintainers? Are they linked to Issues on GitHub or some other system, and what's the activity level on those? Maybe they have a mailing list, Google Groups, IRC, Slack, or something else. Find it, see if it looks active, maybe send out a quick hello and see if anybody responds, and have a chat with them about what you'd like to do, if they're open to that, and how they would like for you to proceed. If they use GitHub issues or some other open issue tracker, you could open an issue for poor documentation or whatever, with an offer to fix it, and see if anybody responds.
Sounds complex, but you should only spend like 10-20 minutes on this. If you can't find clear signs of activity in that amount of time, there's a good chance that the project is abandoned or only accepts contributions from a private group. It may take a couple of days or so to get a response to messages on less active projects, that's okay. If you can't see any activity or get any response from maintainers in a reasonable timeframe, then don't bother. If your contributions are wanted and have a good chance of being accepted into the project, then somebody should be willing to write a few sentences to you specifically telling you so, and outlining how to contribute or where to find a current contribution guide.