Discipline is huge in poker. If you aren't able to focus, you are going to have a bad time.
Sometimes the mind does tend wander or whatever. If you need to, take a break for a bit. Get up, walk around, and come back when you are able to focus. If you are going to get bored and start playing poorly, you will loose a lot of chips. If you get up for a bit and come back when you are ready to focus, you may lose a couple blinds, but it will be impossible to lose your whole stack.
One thing I try and do when I get bored is try to improve my game. Watch the other players, watch their betting patterns, and put them on ranges and see how close you are. Maybe watch for betting patter tells
. Find something to work on during those down times that will help your game. Turn your boredom into a positive.