If you inadvertently infringe on a trademark, and the rightful trademark owner finds out, you will likely first get a Cease and Desist letter warning you to stop using their trademark. I don't think their first recourse would be suing your pants off. (But I am not a lawyer, and I don't know how desirable your pants are.)
The purpose of a trademark is to identify goods/services from a particular source and distinguish them from others. So to keep with the spirit of that, you should avoid doing things that would lead people to confuse your work as being by, or endorse by, other trademark holders (when they're not).
Writing a story that has a ringworld in it, but isn't in any way presented as a Ringworld novel, would (in my lay opinion) not be likely to infringe on a Ringworld trademark (if one applied). Such a trademark would protect the Ringworld universe, but not the idea of a ring shaped world that anyone would reasonably call a ringworld. This should apply to most sci-fi/science concepts.
It is also important to keep in mind that trademarks apply to particular goods and services. The trademark of someone that only sells shoes doesn't apply toisn't an impediment for someone that only sells fruit or other unrelated goods and services. It only becomes an issue when you're trading in the same area. That's why the computer company Apple and the music label Apple have had a few scuffles over the years when the former got into the latter's territory.
YouTo avoid infringing on someone's trademark, you can search for trademarkslook them up them in a trademark database such as https://branddb.wipo.int/branddb/en/
IfFor example, if you look up "Ringworld", there are a few active records, but none are owned by Larry Niven, and the most relevant one seems to only apply to movies and television series. If you look up "Droid", the one'sones owned by Lucasfilm Ltd. seem (to me) to apply mostly to merchandising.
So, in summary, I wouldn't worry about it too much, as long as you avoid presenting your story as being part of a known fictional universe.