How to prevent cucumbers from tasting bitter?
The biggest thing you can do is peel it. If a cucumber's bitter, it's much more in the peel than in the flesh. It's also usually more bitter at the stem end, so you might want to start from the other end, and possibly ultimately discard an inch from the stem end if it really is too bitter for you. Unless you're unusually sensitive to the bitterness, that ought to cover it.

Bitterness is also fairly variable from cucumber to cucumber, so it's possible that you could shop for less bitter ones - maybe a different variety - or buy them only during more favorable seasons.