How to find if socket is taken

hey i know this was years ago but could you show me how you did this please