Might be a nitpick, but you mean the miner puts as many high value transactions as they can fit into a block and then searches for a valid hash?
Technically the miner needs to know what they are going to be including in a block when they begin trying to find a valid hash, but for the sake of explanation I generally switch it around for simplicity.
Whenever you make a transaction in bitcoin, you point to the previous balance you have from a previous transaction, then you say how much you are sending to what address.
The "fee" is the difference between the amounts.
So if I have 1 Bitcoin, and I send .9 to you, the fee is .1
If you want to make sure you keep some Bitcoin, you just send it to yourself.
So 1 have one, and I send .1 to you, and .8 back to me, the fee is .1
Then when a miner mines a block, any unspent money is now theirs, and they claim it via the address they liked for.
And you are correct that bitcoin's ultimate goal is to have mining income come solely from transaction fees eventually. But by that point the hope is that "second layer" systems will take the brunt of the transactions and the actual core blockchain will only be a settlement layer where a $500 fee is no big deal for 2 banks settling hundreds of millions of dollars directly on the blockchain.
So if a fee is 150 "sat/byte" or satoshi's per byte. A satoshi is 0.00000001 of a bitcoin.
So if your transaction is 250 bytes (which is average for a single transaction to a single person), then you will pay (250 * 150) satoshis (37500 sat), which is about $5.
If your transaction is larger, you'll pay more, if it's smaller, you'll pay less.
But they are "ranked" in terms of who is picked first by "sat/byte" since the amount of room in the block is only 1MB.
So a 500 byte transaction with 37500 sats in fees is worth less than a 250 byte transaction with 37500 sats in fees, because the 500 byte transaction takes up more room that other higher paying transactions could fit in.
Sally and Bob each have 1 Bitcoin. Sally received her bitcoin to a single address. If Sally wants to send that 1 Bitcoin to Charlie, that transaction would have 1 input (the address she received it on) and one output (the address Charlie wants to receive it to). Bob has 1 Bitcoin total, but his 1 Bitcoin came from 4 x 0.25 transactions. Bob didn't want to reuse addresses, so for him to send 1 Bitcoin to Charlie he has a transaction with 4 inputs (each address which contains 0.25 BTC) and 1 output. Thus, Bob's transaction is much bigger than Alice's, despite the same amount of Bitcoin being sent.
Since TX fees go to miners, they are incentivized to pick the transactions with the largest "fee per size" to include first to maximize their profit (though they aren't required to do so).
So basically you can envision all transactions as a stack, with the highest fees at the top. Once a block is found, it takes the top ~1MB worth of transactions, and the cycle repeats. [0] is a good visual representation of this.
Unfortunately this means there isn't an easy way to determine what fee will absolutely get you included in a block before it's mined, since if thousands of transactions show up with higher fees than yours after you (but before a block is mined) yours might not make it in the next block (even if your fee was the highest when you made the transaction).
It's a tough problem to solve, but there are some solutions being worked on to help solve this problem for the vast majority of bitcoin transactions.
[0]https://core.jochen-hoenicke.de/queue/#24h