That means you need to have write access to open a pull request and change the code directly in that public repository, which I something I don’t think GitHub offers for security reasons.
To contribute to a public repository you will have to fork that repository, creating your version which you will have write access to, write to that version, and then send a pull request from that version back to the original repository.
That’s how you usually go about it, but look out for CONTRIBUTING.md, LICENSE, and, or, CODE_OF_CONDUCT.md files, if a repository has those you should read them first before submitting any pull request to make sure you’ve followed all the necessary steps they require for a pull request, and you should read the README.md too but that’s in the name so.
Do keep in mind that if a repository doesn’t have a LICENSE, even if it’s visible and public, it’s not considered open-source since it doesn’t have a LICENSE, in that case, I would suggest opening an issue or contacting the owner directly and asking for permission to contribute or asking them for a license.
If you have a public repository and want to give write access to a contributor to edit code directly on the repository you can invite them under
settings > manage access.
Hope that helped.