Step 0: Are you carrying pepper spray? You should be. If a stranger is an actual issue, OC is very likely enough to solve the most common worst-case scenario problems.
Step 1: Relax. Are they really following you or are they also just looking for Diet Coke? You can change your path through the store to something unexpected to see if they keep hanging around. You can pretend you forgot something on the other end of the store, then hop back, but if you are shopping the outside or each aisle in order, so might they. Are they stopping when and where it doesn’t make sense, like they are waiting for you? Perhaps you have ducked into a ladies dressing room and they’re hanging around in the women’s clothing area outside not looking at what’s on the racks and clearly alone and not waiting for someone. Realize, however, that if you are pondering what to choose in an area of a store, like what frozen pizza you want for your Friday night splurge, other people may innocently be doing the same. Being careful and skeptical is one thing; being paranoid is another.
Step 2: Watch to see if they are maintaining distance. Employ MUC (managing unknown contacts) principles if necessary, if they are encroaching on your space. If they aren’t approaching you quickly and aggressively, you can probably start your MUC with verbal boundary-drawing, with no need to jump straight to weapons. “Hey, could you stay out of my space?” can be a great middle ground for normal interactions while still reserving the opportunity to use more forceful measures. Otherwise, continue what you were there to do.
Step 3: If you are more certain than not that they are following you with malicious intent (which is, realistically, super rare), you might stage your pepper spray in your hand and enlist store personnel to interrupt and distract, or provide escort to leave the area. If unable to get to your car without losing your follower, consider going somewhere else like another store or a nearby coffee shop before you head to your car or home.