I have a few tips. Knowing me, it may be a bit long. First, I am glad you take your safety seriously. Some MTF girls begin to like their transition so much that they have excessive confidence where they are the prettiest thing on earth and nobody would ever not like them. This of course is a dangerously unwise way of live. Confidence is crucial but practical confidence is what is required.
A lot of people here have stated that it is unwise to carry weapons without proper training or the will to use them. I agree but at the same time most weapons are not complicated mechanisms. Most will have some sort of manual with them or simply spending an evening sitting down and figuring out how they operate can often bring you up to scratch. Taking classes can help as well but I don't necessarily think they are necessary unless you are trying to learn advanced combat skills. You can practice moves with weapons in your own home such as drawing and aiming but utilize common sense (i.e. make sure everything is unloaded, safety on, etc.). While some people will say you shouldn't have to worry or concentrate on all of this stuff, I disagree. While you don't want to live paranoid, you should live prepared. Anything can happen anywhere anytime. I don't see why any human should not have a basic level of survival skills.
First, the key is avoidance. I would start with "location, location, location." It doesn't sound like you live in the best area if people are loitering around, bothering neighbors they don't know, getting beaten up, drama, etc. I've lived in lousy apartments and eventually had to move. While you may be stuck where you are for awhile, it never hurts to eventually plan on a better area. Even though I was well equipped at handling the threats at my old apartment, I didn't have peace of mind. You want to feel relaxed where you live, not on edge that you may have to engage in battle at any moment.
That aside, since you live where you live, avoidance is important meaning you need to set up social barriers. That means ignoring neighbors other than the friendly nod or "hello," and not loitering around yourself to attract any attention. Next comes privacy. If these people (neighbors or not) are constantly trying to get your attention, they are basically invading your privacy. You have the right to be left alone. I would demand in an assertive way your right to be left alone. A simple statement, "Excuse me, my private life and private business is private. You are not to interact with me while I am on my private balcony and you are not be hassling me when I enter/leave my dwelling." Further abuse by these people after you have clearly stated your intentions to be left alone is generally considered to be criminal harrassment in most jurisdictions. At this point, you may want to consider complaining both to your landlord as well as the police. If they don't live there, they can be trespassed off of the property. If the police are sent to deal with them, they will get their names down which could be used to file a restraining order against them. Beyond making it clear you are not interested in socializing with such people, there is no need to engage in arguments with them or further confrontations. For instance, if you tell them to "F*** off" as they taunt you and then five minutes later are beating at your front door, then simply call 911. As far as I'm concerned, only one warning is necessary and then you are within your rights to call the police. If the landlord clearly allows characters to just be loitering around or doesn't discipline neighbors who harrass others, in most states you can easily get out of your lease.
Next comes creating distance. The greater the distance you are from a problematic person (i.e. nosey neighbor, attacker) the better off you are. This can be as simple as walking up one stairwell vs. the other to avoid someone. Another example is if someone is clearly confronting you, position yourself tactically so that you have at least one escape route. You may take a step back or to the side to continue to give yourself good distance.
As to actual defense, here is what I find to be useful. For home defense, a shotgun. In most jurisdictions if someone is forcing their way into your house deadly force is allowed. Your home is your castle. If someone is forcing their way in your home, you do not know their intentions whether they are there to steal, rape, or even kill you. Either way, their intentions cannot be good. You don't want to argue with them and plus if one person breaks in they could be coming in with a gang. Shotguns are generally one shot, one stop. A gun shop can educate you on good home defense rounds and probably give you a brief overview of the laws regarding home defense in your area. The gun will have a manual showing how to operate it and full of safety tips. If you plan on doing this, make sure you intend to use it. If someone is in your house, if they don't immediately turn to leave, they could quickly take the gun away from you. If you grab it and point it, you better use it.
As to defense outside your home, pepper spray is useful but only recommended outdoors where the spray won't also affect you. It generally does not permenately injure anyone. It is great for creating distance. Even if the spray doesn't hit them directly they are not going to want to walk through it. Within a matter of seconds, you can pull it, aim it, and spray it and while doing so continue to walk backwards.
As to knives, a lot of people don't recommend them but they can be a useful last resort. They create distance when distance is currently not available. It is far harder for someone to take a knife from you than a gun. You don't generally want to stab but to slash. Hitting a couple of arms or legs can cause massive bleeding and will result in death if the attacker doesn't immediately get help. Even if you don't hit him, very few people are going to continue coming at you if you are slashing at them.
Last but not least is a pistol. What is often most effective about it is its deterrance ability. Most states have some form of both concealed carry as well as open carry. Even if an attacker doesn't speak English, they generally understand the language a gun provides. I am a bit of a fan of open carry because of this. Very few people are going to attack a girl they see with a gun strapped to her side. Whether you have it concealed or openly carried, make sure if you pull it you intend to use it. If the bad guy is closing in with a baseball bat and you pointing it at him doesn't make him stop, pulling the trigger will. Gun shops can educate you on proper holsters, retention, etc.
This is kind of a depressing topic but at the same time a necessary one. It is important for all of us to utilize at least a few basic survival skills in our daily lives. It is good to mentally form "what-if" scenarios so we have some pre-prepared plans on what to do. It is useful to know the laws governing defense and weaponry as well. You have rights to be who you are and I for one will not tolerate people violating my rights. While I'm not invincible, it would be unwise for anyone to try to attack me in my apartment or on the grounds without resulting in injury or death to them. While all of this defense stuff seems time-consuming and paranoid at first, as time goes on you get used to it and it becomes second nature. I carry something with me almost everywhere I go and I'm almost always aware of my surroundings at all times and it requires little effort and is clearly second nature. I want to be the one the criminal avoids but if not I want to be prepared to the best of my ability. I find it strange how our society expects people to be academically prepared, financially prepared, and prepared in so many other ways but yet when it comes to personal safety, society thinks you are paranoid and just leave it to the police. Oh well, enough said for one day. Good luck.