Screen not in meeting

Hi, I would like to know how to do the following.

How to check the user is already in the meeting, then leave the current meeting and join the meeting again

Thanks