If you are stopped by police, it is important to consider if the situation is serious enough to seek the assistance of an attorney. The right to counsel is enshrined in the Constitution, so the protection should be robust. It is a powerful shield. However, it is a shield that you must specifically invoke.
Should an officer simply question you, he or she does not have to inform you of your right to legal representation. However, once an officer decides to arrest you then he or she must read you your rights. It is in this moment that you have the right to an attorney.
Television shows get a lot of things wrong about criminal justice, but the one thing they do decently well is portraying how a criminal invokes the right to counsel. You must affirmatively say "I want my lawyer" for the right to be invoked. The burden is on you to make sure that the police know you were serious. No one will ask if you would like a lawyer present, you have to be the one to demand it.
The courts have steadily chipped away at the Miranda protections, but they remain very powerful tools against investigations. Take the time to learn about your rights because, as discussed above, most of these rights are worthless unless you know how to use them.
If you are the subject of an investigation then you may want to speak to a criminal defense attorney. As you can see, you are not automatically informed of your right to an attorney the moment a police officer speaks to you. However, you can choose to have your attorney present. The right to counsel is still a powerful defense against law enforcement. However, it is not an impervious shield and you must act to invoke it.