Best thing to do is to find quieter routes, roads with wide shoulders (some US highways, even with higher traffic speed and volume, can be super nice to ride because of the wide shoulder), and cycle paths if any are available to you. Of course you can't always pick a nice comfortable route and will have to ride on a narrow road with no shoulder, good news is that with practice it will get easier as you become more comfortable with riding and can go at faster speeds. The sidewalk is for walking only.
Where are you located? Odds are decent that somebody on this forum will be able to suggest specific routes in your area.