The eyes are a gateway to the mind.  This being the case, we must be careful of what we allow our eyes to see, or at least to look upon longer than necessary.  We cannot always control what comes into our line of sight, but we can determine how long we look at something.  If you allow yourselves to gaze upon that which is sinful, it will eventually lead to your condemnation.  David, who once gave in to lustful eyes (2 Samuel 11:1-4), learned from his mistake. 

Psalm 101:3 (ESV)
3  I will not set before my eyes anything that is worthless. I hate the work of those who fall away; it shall not cling to me.

There are a couple of things that can help us to have more disciplined eyes.  The first one is to learn to abhor anything that is contrary to the will of God.  Notice that David came to despise, not those who fell away, but their work.  He would not allow such work to cling to him, which meant he would have no fellowship with it.  Paul teaches us to avoid the same thing.

Ephesians 5:11 (NKJV)
11  And have no fellowship with the unfruitful works of darkness, but rather expose them.

In Romans 12:9, Paul tells us to abhor that which is evil.  How does this help us with our eyes?  We will not be inclined to gaze upon that which is offensive to us.  Because David hated evil works, he refused to set worthless things before his eyes.  The same will be true of us today.  For example, the one who despises immodest apparel (since it is contrary to the will of God), is not going to stare at the one who is scantily attired.  The key, then, is to train ourselves to hate what God hates.  This will help us to have more discipline when it comes to that at which we allow ourselves to gaze.

Second, we must desire what is right in the eyes of God.  This is the counterpart to the last point.  Hating what is evil and loving what is good, gives us a double layer of protection.  Paul encouraged Christians along these lines.  Here is the whole of what Paul said in Romans 12:9: 

Romans 12:9 (ESV)
9  Let love be genuine. Abhor what is evil; hold fast to what is good.

What you desire the most in life will play a big role in determining the direction of your eyes.  If you love this world, being materialistic in your thinking, you will have undisciplined eyes, gazing upon that which is contrary to the will of God.  This will lead you down a path to sin.  This is why John warns us not to love this world.

1 John 2:15-17 (ESV)
15  Do not love the world or the things in the world. If anyone loves the world, the love of the Father is not in him. 16  For all that is in the world—the desires of the flesh and the desires of the eyes and pride of life—is not from the Father but is from the world. 17  And the world is passing away along with its desires, but whoever does the will of God abides forever.
 

Where have you set your affections?  If you love God and His will, and if you despise that which is contrary to the will of God, you will avoid having undisciplined eyes and keep your heart pure. 

As you wind down for the night, think about these things.