The Fourth Ammendment is the cornerstone of search and seizure law in the US. I'm going to requote it - and add some emphasis:
The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no Warrants shall issue, but upon probable cause, supported by Oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.
The first key word is "unreasonable." The Supreme Court and other courts have continually recognized that some searches and seizure are reasonable, through a variety of justifications. Some of the factors that are assessed in considering the reasonableness of a particular search or seizure are the extent that the activity in question is regulated (firearms business are heavily regulated, cars are routinely inspected, etc.), the extent of the invasion (looking into an open area versus probing into hidden corners), and the duration of the search or seizure (a few moments to find out why you're in front of a closed business at 2 AM versus several hours for unspecified "questioning.")
The second key word is probable cause. Probable cause is not proof, it's simply facts and circumstances that would lead a reasonable person to conclude that the item searched for is more likely than not to be found in the place named, or that the person more likely than not committed an offense. PC for a warrant is assessed by a neutral party (judge or magistrate), and must be spelled out in a sworn affadavit or statement. Closely related to probable cause is "reasonable suspicion." This is a lesser level of proof, and can be based on facts or circumstances that would only mean something to a similarly trained law enforcement officer. I'll come back to this in a moment...
The last words I wanted to call attention is the phrase "particularly describing." Both the place to be searched and the item to be seized must be described sufficiently to exclude anything else. For example, an address must be specific, and generally describe the building and how to recognize it. The description generally will read something like "a single family residence at 123 Main Street, Big City, of red brick construction, with a the numbers 123 in brass to the left of the front door, which is painted red." Items or persons to be searched for are described in similar detail -- sometimes going on for pages. The idea is simple: what is searched and where it's to be found must be specifically described to (hopefully) avoid invading the wrong person's privacy, or seizing items without justification.
Moving to the specific issue of stopping people on the street... That's covered here in the US by a number of rulings, especially
Terry v Ohio. Essentially, police are permitted to stop a person, and even to conduct a limited search for the officer's protection, under specific circumstances. If, based on reasonable articulable suspicion, the officer believes that a person is possibly commiting or about to commit a crime, they can detain that person -- even forcibly detain them -- long enough to confirm or dispel that suspicion. If there is reasonable suspicion that they might be armed, the cop can conduct a brief search of their outer garments (or similarly, immediately accessible areas like backpacks and waist bands) for weapons. A Terry pat-down is not a search for contraband -- but contraband discovered is often admissable based on several exceptions (which I'm not going into...) to the search warrant requirement. The reasonableness of the length of a Terry stop is judged by the actions being taken to confirm or deny the specific suspicion; it may take some time for calls to be made, owners to be found, and the like in some cases while others may only take a minute or two, like confirming that a person isn't a wanted subject whom they resemble.
Additionally, a law enforcement officer, just like an ordinary person, can walk up and talk to anyone. We can even ask for voluntary consent to a search -- which can be as thorough as the person granting consent permits.