Handle Invisible Element

If any Element of the application sometimes visible or sometimes not visible - How it should be handle in Selenium WebDriver?

In this situation create script while the element is visible. After creating script the code should be surrounded by Try ..... Catch method or with the help of IF ..... Else statement. 
I hope it should be solved.