When something strikes you as wrong or out of line, keep your emotions in check. No one, especially the boss, will appreciate an emotionally charged rebuttal. People tend to mirror each other's energy level, and if you turn red and flap your arms, it will be met with equal intensity.
The conversation will go much better if you are addressing the issue or topic and not making your disagreement about the person, your boss.
Nothing falls flatter than squashing an idea only to have nothing to replace it with. If you can't think up a better idea, then what good is the disagreement? Sure, you might not like the idea, but if you can't come up with something else, then go with what you have. You have to solve problems to be an asset.
Depending on the setting and issue, you may need to take your disagreement to a private setting with your boss. This allows you to cover whatever you need to, have a discussion, and keep both of you looking good to the rest of the office.
If you can't articulate what is troubling you about something, wait until you can be clear. If you can't be clear, you will not have a conversation that will make any sense to the other person. A confusing conversation will not leave a great impression.
This is more than simply sucking up to the boss. This is agreeing with the boss at the cost of your character, values, and career. You might think it will enhance your career, but it will backfire against you as the higher-ups see that your contributions are limited.
Many conflicts and disagreements are rooted in a failure to communicate and understand the other person. When something does arise that doesn't hit you right, ask questions and gain clarity. You may discover that you do agree after all. Doing this will also help you avoid discomfort.
The biggest issue that managers have when employees disagree is their becoming insubordinate and undermining efforts. If you have followed all of these steps and you still have a disagreement, then it's time for you to disagree and commit yourself to whatever is being proposed.
After all, the idea or direction might really work out well. Your manager will think you are truly a professional if you can work through your disagreement, offer solutions, and be able to "get on board."