Since you didn't mention specifics (such as exactly what these people did), here are some non-specific recommendations:
Communicate your non-interest in them clearly.
Start with something like a simple, "No thanks."
If they persist, then something like, "Please understand that I have no interest in a platonic or romantic relationship with you. Please stop immediately."
If they need a third strike, "If you don't stop, I will go to the authorities and pursue a restraining order."
And do just that.
If you are having trouble with harassment (aka, people who constantly contact you on the phone/mail/online, show up at your doorstep, or physically harass you), then consider the following:
Learn diplomacy. At the worst, you can instantly diffuse ugly situations. At the best, a semi-stalker can be made into a legitimate fan who learns how to keep a respectful distance.
Maintain your privacy. Don't give out your personal contact info. Instead, use a agent.
Learn self-defense. Take classes. Don't be a victim, inside or out. This will be beneficial on many levels.
Good luck!