How to check if user is member of one of the groups from a parent group

Khalnayak
Kilo Sage

Hello,

I am creating a business rule in which I need to check if current logged in user is member of any of the child groups of a certain parent group.

And if user is a member of any of them groups, then code can continue and display the appropiate message.

How can I achieve this please. need code help