If it's just prophylactic, after a basegame-update or being recommended in an ongoing troubleshoot; cleaning up your game installation and related files every now and then is not the worst idea. Given modern download-speeds it is usually a rather quick process and the most 'tabula rasa' approach to start from a pristine position in cases you can't find a quick solution to an ongoing problem.
This is especially true in regards to mod-files, since it is a rather common occurrence of Steam corrupting mod-files through auto-updates. Issues caused by such corruption are often hard to spot with just an error-log and can cause troubleshooter significantly wasting time, looking for solutions in the wrong places. Therefore making a clean re-download of at least your whole mod collection before even starting a troubleshoot is a highly recommended preparation. Often troubleshooter will instruct you to do so as one of the first things anyways, so coming prepared will just speed-up the whole process and saves time for everyone involved.
RimWorld in general has a rather small footprint when it comes to its installation. It's DRM-free file-structure runs out of the box without the system having to write (much) information into the registry and it comes without the need of installing any runtime-libraries. This means that basically all its data and references are roughly spread across three major locations on your system.
The main location is the game-installation itself. Based on a Steam version of the game, this usually would be in your SteamLibrary:
..\SteamLibrary\steamapps\common\Rimworld
Other versions of the game (GoG, EGS, DRM-free, etc.) would be found in their respective locations which are usually user-defined though. Ideally you should know where you put your game, but most game-launchers have built-in features that take you there and even the potential shortcut on your Desktop to start the game would show you the location if you open its properties.
The second major place that is relevant for the game is the mod-folder. For non-Steam installations or locally installed mods this one is directly within the game-installation itself. So deleting the former one takes care of this as well. Typically that would be:
..\Rimworld\Mods
Steam handles mods differently though. So if you have a Steam-version of the game, all your subscribed mods will be automatically downloaded in its own Steam Workshop folder:
..\SteamLibrary\steamapps\workshop\content\294100
The last relevant location is your user-folder which contains your game-settings, mod-configurations, save-files, error logs, modlist-file and eventual custom presets (xenotypes, scenarios, etc.)
..\Users\YOUR_USERNAME\AppData\LocalLow\Ludeon Studios\RimWorld by Ludeon Studios
In most cases just deleting those folders by hand will suffice to cleanly remove the game's content. This is specifically relevant since automatic methods (uninstalling in Steam, etc.) might not always remove files as cleanly as you want it. So relying on them can even defeat the purpose of the whole process. Thus make sure to delete the folders by hand so no files are left behind.
For the game-installation and the Steam Workshop folder you shouldn't need any precautions. The game doesn't save any dynamic data in those locations, so after deletion you can just re-install the game with Steam and it will re-download all game-files as well as your mods from scratch.
One caveat here is your local mod-folder though. Obviously you have to re-download any local mods you had there after deleting it (or the game-folder as a whole) and place them here again after re-installing the game.
The other more complicated case if of course your user-folder. Depending on the situation and your goal, there might be some files in here you want to keep. You can either leave them there while deleting everything else, or just move them out of the folder before deleting it as a whole. After re-installing the game and running it once you can then move those files back into their former locations. A list of potentially important files follows in the next section.
There is no good way to generalize which files to keep and which not - it solely depends on the individual situation. But as a rule of thumb it is recommended to delete anything that isn't specifically needed for the cleanest result.
Often keeping just your latest save-file might be enough, but if you want to continue an ongoing save you should also keep in mind that if you delete your mod-configuration-files, you might have to set your mods up again after cleaning up. While it isn't critical in most cases, some mods have to be set-up as they were before if you want to continue your save - otherwise it could result in unintentional issues or even broken savegames. Besides your save-files, custom presets and your ModsConfig.xml, all other files will be re-created when you start the game for the first time again after the clean-up.
Savegames
..\Users\YOUR_USERNAME\AppData\LocalLow\Ludeon Studios\RimWorld by Ludeon Studios\Saves
Vanilla Presets (xenotypes, starting-scenarios, ideologies, etc.)
..\Users\YOUR_USERNAME\AppData\LocalLow\Ludeon Studios\RimWorld by Ludeon Studios\Scenarios
..\Users\YOUR_USERNAME\AppData\LocalLow\Ludeon Studios\RimWorld by Ludeon Studios\Xenotypes
..\Users\YOUR_USERNAME\AppData\LocalLow\Ludeon Studios\RimWorld by Ludeon Studios\Ideos
Mod Presets (like exported characters with Prepare Carefully, Character Editor, etc.)
..\Users\YOUR_USERNAME\AppData\LocalLow\Ludeon Studios\RimWorld by Ludeon Studios\RocketMan
..\Users\YOUR_USERNAME\AppData\LocalLow\Ludeon Studios\RimWorld by Ludeon Studios\CharacterEditor
Etc.
ModsConfig.xml (this contains your current modlist and loadorder)
..\Users\YOUR_USERNAME\AppData\LocalLow\Ludeon Studios\RimWorld by Ludeon Studios\Config
Mod Configurations (settings and configs for individual mods)
..\Users\YOUR_USERNAME\AppData\LocalLow\Ludeon Studios\RimWorld by Ludeon Studios\Config
Player.log-file (the log-file of your current or last RimWorld session)
..\Users\YOUR_USERNAME\AppData\LocalLow\Ludeon Studios\RimWorld by Ludeon Studios