If building in question allows circuit network connection with red/green wire, then reading data might be as easy as that.
Lua code will be necessary to do anything with that data of course, as this is a lua code combinator after all :)
If building doesn't support circuit network connection, good option might be to install some other combinator mod that'd do the reading and make such data available.
https://mods.factorio.com/mod/Circuit_Power_Measurement_Combinator for example does that for power, but iirc there were mods to control assemblers and such too.
And then it's back to the first thing - connect that mod-added combinator to lua logic via wire in-game and script whatever you want there.
Last option is using factorio modding API via "_api" value (see last question in FAQ about it), which gives you access to this:
https://lua-api.factorio.com/latest/index-runtime.html
There you can for example find nearest building of specific type to a combinator, and do anything with it that factorio modding API allows to, which is usually pretty much everything, but you'll have to lookup which specific properties/methods to use in the docs, or can also search forums and other mods' code for how they do it.
At that point, you're kinda making your own mod, and if it's something that can be generally useful, can probably throw custom combinator in there and publish as a mod on mods.factorio.com - like that trivial power meter mod linked above.
Question seem to be a bit too broad to give one definitive answer, but hope it helps.