When you mine, how do I know that I found a Bitcoin?
If you're talking about a single Bitcoin, you never "find it out". At least, not like a piece of gold from the underground. In Bitcoin, you're rewarded for helping the network to extend the chain with all the transactions ever made. To do that, computational power is required.
Why is it required?Because nodes are programmed in a way to accept the chain with the most effort dedicated. This way, if the majority of the computational power is owned by nodes that want to protect the network, then they'll outpace any attackers that will try to change past blocks.
What exactly am I calculating?SHA256 hashes. If you don't know what is a hash function at all, think it as a function that can be used to map data of arbitrary size to fixed-size values. For example if you hash the text "I'm BlackHatCoiner and I don't own any altcoins." then you'll get this hash result:
6139b7e6357e2c1a89fdbed42dfd9b867c5c7bb3be0384d59363c57c9a2d0ad0
Each time you hash a different message, you get a new unique SHA-256 result, the so-called message digest. [
Try it!]. In order to mine a new block (that will reward you with 6.25 bitcoins at the moment), you have to perform SHA256 to the
block header. A block header is consisted of some important fields that define your block. There's a field called "nonce" which is just a number. By changing this number you'll get a completely different hash each time.
In order to successfully mine a block, you'll have to find a message containing the block's structure in which once you perform SHA256 to it, it'll return you a hash below a certain target. That target is calculated by the network's effort and it changes every 2016 blocks to ensure that no matter the total miners, each block will be solved every 10 minutes on average.
For example: If target is equal with:
00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff
You'll have to find a hash that is not greater than that.
After many many tries...
45a9c90dbd4632398396d550dbf383a428d6920ba5dddf356d895c6baf928bb9 <- Nope.
491a0a72eb51cb35a1181adafe8ea04474b414f2599b0ed26a7f019fa4f1cc81 <- Nah.
ec43dd411ce7ac6707a502a7c80b61cf8fc4cd66015f03a5c127ec8f28e5bdaf <- No.
b53c6386c451653cf740285cd65eca05b41c5da889fafaa06e4dc1dabfb53826 <- Neither.
00000000827d29aff6dd1f65c772885502960a7416957e5a00dfcff8a4374bdc <- Bingo!
So once you find that hash you can broadcast it to the network along with your block's information and the nodes will accept it if it's valid. You understand that the faster you can calculate these hashes, the more possibilities you have to find such hash. It's a competition. If you can calculate ~100k hashes per second, then you have no chance against a man who owns machines that can generate the 1000x.