The most crucial part of troubleshooting any issue around your game is giving potential troubleshooter all the necessary info to work with. There are close to zero cases where providing a full log isn't necessary or at the very least helpful for the process. And since it only takes seconds to provide such log, there should never be a reason not to give this information from the very first second of asking someone for support.
In fact, not immediately adding your log to a troubleshoot-thread or similar can drastically decrease your chance of getting help and will usually just prolong the process unnecessarily. So don't wait until you're asked to provide a log, just open the process with it - what helps your case and makes the lives of troubleshooter easier as well.
As for the process and what sharing specifically there are basically two main types of logs. The game's own Player.log-file which is always written by the game and is available even if you don't get into the game or encounter crashes - and the so called Hugslog, which needs you to use a mod and creates logs from inside the game which have additional information and offers some other benefits. Whenever possible, a full Hugslog should be the preferred way of providing information about your case - but if that's not possible for whatever reason, just pick the next best option of your Player.log.
The Player.log-file is written by the game itself and is located in your user-folder. The game writes any internal logging of errors or debugging into it, including some basic information of your hardware and system. Whenever you start your game, the file is written from scratch and the previous one renamed to Player-prev.log and kept as backup as well. This can be important because that way you always have access to your last two game-sessions. You might want to keep that in mind when providing the log to someone while troubleshooting game-issues, so you don't give them the wrong file from the wrong session - like one the error you're investigating didn't happen.
As for the contents of the log it seems to be outside the scope of this quick-guide to explain too much of it. If you're not already able to read and understand what is printed in there, you might not want to start learning about it when you currently ran into an issue with your game and maybe even need outside support to fix it. This might be content for a future - in-depth - guide on common errors and how to navigate and understand the logging, but for now let's just stick to the basics.
Typically the Player.log-file always should be your fallback solutions if other - more detailed - options are not available. It also is the only way to share your log in cases of the game crashing, especially whenever the game doesn't even start into the main menu. In the case of crashes, it often also contains the crash-stacktrace which can help to quickly find out why that happened. Something you obviously won't have in something like a Hugslog since the crash itself would prevent you from sharing that information.
In addition you want to always share your modlist as well when providing a Player.log for a troubleshoot. The log only includes the list of used mods under very specific situations - but for a troubleshooter this additional information can be important. Thus you either want to share that info via available methods or at the very least, drop your ModsConfig.xml alongside your Player.log to provide the full context of your situation.
The so-called Hugslog is a more detailed source of information than the game's own log-file. It's typically provided by using the mod Hugslib but nowadays there are different ways of getting access and sharing it. You get access to this type of log by either using the Share logs button, the mod adds to your ingame debug-log or using one of the keyboard shortcuts. Ctrl+F12 will share the log the regular way of the mod uploading the log to Github/Gist and then giving you back the link, so you can just copy that and share it with everyone easily. Of course that requires an active internet-connection to do so and there can be times the process fails for different reasons. If that's the case for you, Ctrl+Alt+F12 will put the log into your system's clipboard instead from where you can access and provide the log via different means. This of course is quite more complicated and usually involves you either saving the content of your clipboard into a text-file or uploading it to Gist (or different text-hosting service) yourself before you can share it.
As already mentioned; whenever possible you want to share your log this way since the Hugslog contains additional info that is often important for the troubleshooting-process. Other than the Player.log, the Hugslog also contains your full modlist in an easy to read format, so you don't need to share it additionally and have everything in one place. Another benefit is that some communities might not allow you to directly upload your files to share with people, so getting provided a direct link to the log with just one press of the shortcut is just superior in every single aspect.
As right now there are two mods providing this functionality. Of course the original Hugslib which still contains other features besides the log-function but also the standalone Log Publisher from HugsLib by M00nl1ght which only contains the log-functions without any of the old and deprecated code in the original version. While there is not much to it, the recommendation here would be to use the standalone version whenever you just need to share your log and use the original one whenever any other mod on your list requires it as a dependency to begin with. There shouldn't be any reason to use both mods together, but it still will work regardless. The standalone mod was created a while back when Github blocked the API-key of the original Hugslib so the upload-feature stopped working. Since the original author rarely shows up to update things these days and such situation can happen again - at least in theory - having an alternative from a more active and approachable author is still a good thing. So keep that in mind if by chance you're using the original mod and the log-upload fails for you consistently.
In the case of Hugslib (or the standalone Publisher) not being able to upload the log to Github because of an issue with the API-key, there is also the option for the user to use their own API-key. This of course can be done even if things are otherwise working properly - like if you want or need your logs to be stored directly on your account so you keep access to them. Usually that would at most be a feature to be used by modder or troubleshooter, so it's not exactly the best place here to go into too much details. But it should at least be noted for cases all other upload-possibilities otherwise fail.
To access that feature you just have to check Custom Options after pressing Ctrl+F12 which allows access to some advanced settings, including an input-field for your personal Github access token
In general most file-hosters will work to share your logs, but there are quite some differences in usability & availability (region-locks.) Unfortunately this situation tends to change quite momentarily and legal intervention in specific nations are known to ruin the usefulness of specific services basically over night. Things like legally enforced word-filters and similar make affected services useless for the purpose of sharing error-logs - since you will never know which word in your log of ten- to hundred-thousands of words triggered their system. But also just how a site is displaying the text (line-wrap, etc.) can make things unnecessary tedious for those trying to read it.
Because of that we keep this list simple for the moment and only promote the most established services that are known to offer the best usability for this specific purpose. If you have your own preferred service we just recommend thinking about how easy it will be to use by another person to not make their work harder than it has to be. Some troubleshooter might just ignore your case when they run into some roadblock reading your log - so you're not doing yourself any favour by picking a bad option. Besides that, it's left to user-discretion though.
Gist (Github) is the direct text-hosting service by Github and the same way Hugslib itself uploads and shares its logs. Because of that it would be the preferred method. The main downside here is that to upload your log to Gist, you need a Github Account in the first place.
Pastemyst is a simple and quick service usable without prior registration. Its main purpose is for sharing code but the readability of RimWorld logs is still good enough. Ideally select 'Plain Text' in the language selection before uploading.
Pastebin is probably the most popular service right now but already comes with some downsides. RimWorld logs tend to trigger its word-filter what basically makes the log inaccessible without actually telling the uploader what triggered it in the first place. It's fine to share our log with it when it works, but since that's always a gamble you better use any of the other services if possible.
Since issues with Pastebin have been coming up more and more again, consider this option not being recommended anymore. It's just not worth the hassle. If someone has some suggestions for alternatives, feel free to hit me up. We will look into some better recommendations here, but right now we're not aware of any good sites besides the previously listed ones.