Thank you, i think i'm better understanding now.
So, if i made a transaction, send it to a node, this node checks if the transaction is correct, and broadcast it to other nodes, right?
Correct. And those nodes broadcast it to other nodes, and so on until nearly the entire network is aware of the transaction. This is how the transaction gets from you to the wallet that you are sending to, and it is how the transaction gets from you to the miners.
When you broadcast the transaction, it is "unconfirmed". It is "valid", or else the nodes wouldn't relay it, but if you were a scammer it would be possible for you to transmit 2 different transactions that spend the exact same bitcoins to different nodes on the network at the exact same time. Then nodes wouldn't know which is the "REAL" transaction, and which is the invalid one. They can't just assume that the one they get first is the REAL one since different nodes would get different transactions first. The network needs a way to reach a consensus agreement on which transaction to treat as the REAL transaction. This is what the blockchain is for.
And in which moments the miner comes in?
The miner software chooses unconfirmed VALID transactions that it knows about and combines them into a block of data with a header. Then it begins the proof-of-work process. The block won't be considered valid by the network until the proof-of-work is complete. The first miner that completes the proof-of-work gets to broadcast his VALID block to all the peers that he is connected to. They check to make sure it is valid and then relay the block to all the nodes they are connected to. Thie relay process continues until all nodes on the network are aware of the new block. Once a transaction is in a block, it is "CONFIRMED" and is considered to be the "REAL" transaction. Any other unconfirmed transaction on the network that tries to spend those same bitcoins is then considered to be INVALID and it ignored and removed from memory by any nodes that receive or are storing the invalid unconfirmed transaction.
This is how the network reaches a consensus agreement on which transaction is REAL and which is INVALID.
Now, it is possible that two different miners each mine different blocks with competing transactions spending the same bitcoins. Each node will accept whichever of these two blocks they receive first. Some miners will receive one of the blocks, other miners will receive the other. Since the blocks are at the same height in the chain (same total proof-of-work in the chain), each miner will just accept the first valid block it receives and will start building a new block on top of that. There will be a temporary fork in the chain with two different blocks at the same height. Eventually a miner will solve a next block and will broadcast it. All miners that were working on top of the same block will just accept this new block as an extension of their chain and will continue as normal. Any miners that were working on top of the OTHER block will see that this new block is part of a longer chain now. They will abandon the block they are working on AND the previous block that they had accepted, and replace them with the two blocks from this longer chain. They will then start working on a new block on top of these two that they've just accepted. In that way the network eventually reaches consensus on which chain is the correct one.
Should the miner not mine it first before a node broadcast this transaction?
The miner doesn't know about the transaction until it has been broadcast and relayed to him.
How do the miner know that there is a new block?
They receive it from one of their peer nodes, which received it from one of their peer nodes, which received it from one of their peer nodes, which received . . . which received it form the miner that completed the proof-of-work on the block.
is the miner connected to all nodes?
No. The miner is just running a peer node in the decentralized network, just like any other node. He just happens to ALSO be assembling blocks to work on from the list of unconfirmed transactions he knows about and performing the hash proof-of-work.