Good way to test for Unpublished Content

Hi,
I’m looking for a coding tip.
Quite a few of the errors we’re getting with Umbraco (be it via the Rich Text Editor with macros or the preview page) seem to have the underlying issue that we are referring to unpublished content.

This is often via a macro referring to the content in a content picker.

Is there a good way to test in code for whether content has been published, where I have the content id?

Many thanks


This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/75573-good-way-to-test-for-unpublished-content