With the new questions and mention of context, here is what I hope will be a more concise answer, but first I should elaborate on the key three rules you are looking at, as I believe there is some confusion there with how they all interact:
The DM decides when circumstances are appropriate for hiding. When you try to hide, make a Dexterity (Stealth) check. Until you are discovered or you stop hiding, that check's total is contested by the Wisdom (Perception) check of any creature that actively searches for signs of your presence.
This part of the rule clearly states that it's up to the DM to decide when you can, and can't, attempt to hide. It also points out that after you make a Stealth check, that is contested by the Perception check of any creature actively searching for you.
You can't hide from a creature that can see you clearly, and you give away your position if you make noise, such as shouting a warning or knocking over a vase. An invisible creature can always try to hide. Signs of its passage might still be noticed, and it does have to stay quiet.
The part referencing that you can't hide from a creature that can see you clearly may answer your first question about giving away your location, as that concept would refer to you being clearly visible, making an audible noise, or anything really that the DM considers giving away your location.
In combat, most creatures stay alert for signs of danger all around, so if you come out of hiding and approach a creature, it usually sees you. However, under certain circumstances, the DM might allow you to stay hidden as you approach a creature that is distracted, allowing you to gain advantage on an attack roll before you are seen.
The first part of this final paragraph of the rule states that most creatures would be aware, therefore if you were hiding in a bush, or behind a wall, and you suddenly moved out from behind the object or obstacle, you would be making yourself visible once more. I would rule that this is overt enough it does not require a check, however, it could be argued that if you are doing this behind someone to attack them, it's surprise, and if it's not to attack them but rather to move, it would prompt a Perception check per the first paragraph's explanation.
As a point of addition, there are many MUITOS conditions that go into whether or not a creature is visible or not beyond them hiding, as mentioned in the rule itself:
What Can You See? One of the main factors in determining whether you can find a hidden creature or object is how well you can see in an area, which might be lightly or heavily obscured, as explained in chapter 8.
When you take the Hide action, you make a Dexterity (Stealth) check in an attempt to hide, following the rules for hiding. If you succeed, you gain certain benefits, as described in the "Unseen Attackers and Targets" section later in this section.
As you can see, the "Hide" action is simply the method in which you enter hiding, all the rules for the "Hide" action are described in the "Hiding" rule, rather than the "Hide" action itself, the benefits gained from "Hiding" are the benefits gained from successful use of the "Hide" action, which are yet to be explained...
Combatants often try to escape their foes' notice by hiding, casting the invisibility spell, or lurking in darkness.
Mention of "hiding" may very well be a reference to the "Hiding" rule and "Hide action".
When you attack a target that you can't see, you have disadvantage on the attack roll. This is true whether you're guessing the target's location or you're targeting a creature you can hear but not see. If the target isn't in the location you targeted, you automatically miss, but the DM typically just says that the attack missed, not whether you guessed the target's location correctly.
This section focuses on what happens with creatures attacking an unseen target, or you if you are using the "Hide" action successfully, so all the effects and rules for that condition have already been covered and are based on those rules and not the rules purely discussed in the "Unseen Attackers and Targets" rule.
When a creature can't see you, you have advantage on attack rolls against it. If you are hidden--both unseen and unheard--when you make an attack, you give away your location when the attack hits or misses.
This section focuses on what happens when you are unseen, or "Hiding" and attack a creature. To clarify on the rule a bit, as you make the attack, you are still considered to be "Hiding" and therefore benefit from the advantage, you give away your location after you've made the attack, regardless of whether it hits or not.
The Questions
If you're still wondering about those questions and why I just unloaded those rules on you, it's mainly to give you context to my shorter answers that will make reference to them:
- Giving away your location can mean many things, I would refer to the "Hiding" rule and the "What can you see?" segment for that. If the location no longer has to be guessed, there is no disadvantage in play and it is a wholly ordinary attack process. There are no other implications beyond losing the benefits or conditions granted by these three rules mentioned.
- If you change location, you are likely going to have to reference the "Hiding" rule for confirmation as to whether you are no longer considered to be hiding or not. This is a case by case thing and is ultimately up to your DM.
I hope this answer has explained all you need and I'll provide further clarifications if I've been unclear.