My first boss was a gruff fellow prone to yelling who had an imposing physique and a demeanor that radiated being in charge. He was not, and presumably is not, someone an entry-level college student, which I was at the time, spoke to unless invited.
In the years since, I've had bosses ranging from thoughtful to full of rage, as well as micro-managers and ones who barely seemed to know I existed. I've generally gotten along with whoever I worked for, partially because no matter what type of boss you have, there are certain rules to follow, at least at first.
Above all, show respect
In my first job, on the rare occasions I interacted with the boss, I was appropriately deferential. That's a scale that moves a little based on age and experience. Had I been a 40-year-old company vice president with deep experience, I could have been respectful but acted more like a peer.
As a 20-year-old glorified intern, what was appropriate was a lot of "yes, sir" and "thank you." That attitude, plus a lot of hard work, eventually brought me a level of mutual respect with that boss. I never stopped being respectful. But as I earned his trust, I was able to offer my opinions and be more of a respected colleague, and less of a blindly devoted employee.
Remember, the boss is the boss
No matter how kind the boss acts toward you, remember that this is the person who judges your performance. Even if you become legitimately friendly or have a boss who blurs the line between work and personal, be careful how you act.
It might be OK to tell a friend that you stayed out too late the night before and remain hung over. That's not a thought you should share with the boss. The same goes for any other minor transgressions, such as how you blew off the end of the trade show to hit the casino or go to the hotel pool.
Follow the boss' lead
Some bosses are the of-the-people type, while others set themselves apart. If you have a boss who on your first day takes you to lunch and then routinely pops by your desk to chat, you know you have an easier path to communication. In other cases, the person in charge may occasionally address the entire office but rarely has one-on-one conversations without an appointment, making things perhaps more difficult.
It's up to you to adapt to the boss' style. If it's a "my door is always open" policy coupled with someone who likes to talk, then feel free to chat. If your boss prefers more formal methods, then you have little choice but to operate accordingly.
It's just a person
In most cases, the boss isn't Lex Luthor or Mr. Spacely, prone to fits of rage or willing to fire people for small breaches in protocol. If you end up with a boss of that type, there may be very little you can do, aside from being respectful and doing your job well. If things are intolerable, then it might be time to leave.
Be confident. Learn how your boss likes to communicate and operate within those parameters. Remember that most bosses were once employees, and they probably have some sympathy for a subordinate worried about how to talk them.
Unless you're in an extreme situation, talking with your boss should be no harder than talking to any other authority figure. Start with respect and deference, but adjust your demeanor as familiarity and respect build.