How to check a Sub-section of a Course is published or not

Hello everyone , I want to get all subsection published to display , is there any function to check if a sub-section published or not, I’m using lilac version