Your understanding of mining is correct. Using standard mining, you work on your own trying to hash a block trying random nonces until you find one that works.
When you find a block, you write in your bitcoin address into the coinbase transaction in the block and you receive the block reward (currently 12.5 BTC).
However, like you say because of the lottery principle, the probability that any single miner will find a block is tiny, so how do people make 0.00x BTC a day instead of making 12.5BTC every few decades? (when they find a block by chance).
This happens because of mining pools. A mining pool is a group of people that work together to mine, and when one of them finds a block they split the reward based on how much work each miner did. This means that you earn the same amount of BTC every time the pool mines a block, regardless of who in the pool mined it (giving you stable income).
When mining in a pool, you don't mine blocks directly, but you mine a subproblem created by the pool (esentially much easier blocks). This means that the pool can actually verify how much work you did by checking your solutions to the subproblems, instead of just trusting every miner to correctly report how much work they contributed.
This also means that a miner can't just take the block for themselves, as only the pool has the information to actually construct a block. Thus, many people can mine together without every miner needing to trust every other miner. They just need to trust the pool. The pool usually takes a 1% cut or similar of the mining reward.