I cast pyrotechnics (smoke effect, create heavily obscured area) and stand inside of it. Does it mean I can see what is around me and others are effectively blinded when trying look at/attack me?
Pyrotechnics isn't a 5E spell, but
fog cloud (also creates heavily obscured area) would illustrate your point. No, you can't see out of heavy obscurement (unless you have a special sense to overcome it, i.e. darkvision for darkness, blindsense for heavy fog, x-ray vision for a stone wall) so both you and your enemies outside the fog are effectively blinded with regard to seeing each other.
But say you have a class feature, spell or item that is actively giving you blindsense at the moment. You cast fog cloud centered on yourself in a room full of guards. You're now heavily obscured. If they shoot crossbows at you, they have disadvantage, being
effectively blinded when targeting you. If you also successfully hide, they don't even know what spot you're in within the fog, so may fire at an empty position. (Some DM's might rule this to be the case anyway, without needing the hide roll.)
Once they enter the fog, they are again effectively blinded by the fog, having disadvantage attacking you.
What you have is open to interpretation. Since you can see them with blindsense, you can "see" through the fog, and do not have disadvantage. Since they are only "effectively" blinded, and not actually, do you get advantage like you would against someone with the Blinded condition? Eh. Maybe. DM call. It might be better to interpret the situation as you're
effectively invisible to them, and would have advantage in that case. Same would be true of a darkvision creature attacking a normal sighted creature in total darkness.
You already have advantage, why would you use the Hide action in this scenario? Once you attack, your position is given away. Even though it's with disadvantage, the opponent can still attack you back. Using Hide, you could quietly move around so they lose track of you, and again, might be swinging their sword at an empty space.
Edit: I cast minor illusion on the place where i stand. I create black 5-foot cube. What will happen when i attack someone or someone try to attack me?
If you've successfully hid in the area of the illusion without anyone observing you first, you'd gain advantage on the attack. But as soon as it's determined whether your attack hits or misses, your position is given away to the opponent. Because you've thrown an illusion into the mix, it gets a little more complicated.
So some lucky guard got a hit in and disrupts your concentration on your fog cloud. You run up a stair case, guards in pursuit. Entering a bed chamber, you cast an illusion of a dresser over yourself and hide within the illusion. You know it's an illusion, so you can see through it just fine.
A servant comes in to replace some pillows. Your Stealth check only needs to beat their Passive Perception, because they aren't looking at you. It's close, so they look at the dresser because they know this room and it looks out of place. But they think nothing further of it and leave.
Now a guard bursts in the room. He's looking for you, so he makes an active Perception roll against your Stealth. He doesn't notice your boot toe sticking beyond the illusion edge or hear your heavy breathing from crouching awkwardly within the illusion. The guard moves toward the closet past you, and you attack with advantage, because you were still hidden. Now, if you have enough rogue levels, you can try and hide again in the illusion because you're still heavily obscured, but the guard knows where the attack came from. He may take an action to see through the illusion, in which case he sees you, you are no longer hidden, and he can attack normally. Or, he just attacks the dresser normally, which he can see, and will probably hit you when his sword passes through it. And then once again, he can see through the illusion.
If the illusion was just simply a solid black cube, well, that's a really
obvious illusion; I'd rule opponents would be suspicious and alert around it anyway, ruining any advantage of an attack from hiding.
Some of that is still getting a little into DM call area. If you cast a black 5-foot cube illusion over yourself during combat in the middle of an empty room, you're heavily obscured, out of the line of sight of enemies, but as a DM, I'm not going to rule that you're in the game sense. The enemy knows exactly where you are; you aren't going to get advantage on an attack if they walk up to the cube, nor will they have disadvantage shooting at it. Same with hiding behind a lone tree in a field. They may have disadvantage because you have cover, but not because you're hidden. But if you're a wood elf (hide in light obscurement) and move behind a 20' long row of hedges and hide, I'd allow it, because your exact position is in question. Shooting an arrow through the hedges or stabbing someone approaching them who has not beaten your stealth check is going to be an attack with advantage.
The situation that causes the most debate is if it were a 20' low stone wall, and the character hiding pops up to make a ranged attack. Do they still get advantage for hiding, or are they now out of hiding to make the attack? For me personally, it's a "it depends" situation. Hidden behind the wall before combat started? Advantage. Hide after combat started, shooting opponent with clear view of wall? No. Shooting opponent on far side of combat area focusing on something else? Probably.