First, you have to figure out what the cause of your symptoms are.
There are two likely causes to missing straight shots. First, you may not be hitting the cue ball where you intended. Second you may not be aligned correctly. A combination of those two problems may also be the cause of your misses.
If you aren't hitting the ball center, you have to figure out why you didn't hit center. It probably has something to do with your mechanics. Twisting the wrist, having too much elbow movement jumping up before the shot are some of the usual culprits. What ever your problem is, you should figure out what it is by hitting extremely slow shots and a striped ball as a reference to where you are striking the cue ball (by looking at the chalk mark). A slow shot will help you realize your body is doing when you are shooting and allow you to fix whatever you need to to make your stroke straight.
If you are misaligned, you may want to get a friend to look at how you line up with the shot abd give you feedback on how you are lined up. Misalignment is a difficult problem to self diagnose, so it helps to have a second set of eyes to help you out.