Four ways to choose a hole
When a process needs memory, the operating system has to pick a free block (a hole) big enough to hold it. First fit takes the first hole that is large enough, scanning from the start. Best fit takes the smallest hole that is large enough, leaving the smallest leftover. Worst fit takes the largest hole, leaving the biggest leftover in the hope that it stays useful. Next fit works like first fit but carries on scanning from where the last process was placed instead of going back to the start.
The classic exercise
Silberschatz's Operating System Concepts asks: given partitions of 100, 500, 200, 300 and 600 KB in that order, how do first, best and worst fit place processes of 212, 417, 112 and 426 KB? With leftover space staying free (variable partitions): first fit puts 212 in 500, 417 in 600, 112 in what is left of the 500 block, and 426 must wait. Best fit puts 212 in 300, 417 in 500, 112 in 200 and 426 in 600, placing all four. Worst fit puts 212 in 600, 417 in 500, 112 in what is left of the 600 block, and 426 must wait. Best fit makes the most efficient use of memory in this case. Load the example to see every step.
Variable or fixed partitions
Textbooks set the problem up two ways, and the answer changes. With variable partitions, a process takes only what it needs and the rest of the block becomes a smaller hole that later processes can use. With fixed partitions, each block holds exactly one process and the unused part of the block is wasted: that waste is internal fragmentation, which the calculator totals. Choose the version your question uses.
Fragmentation
Even when there is enough free memory in total, a process can fail to fit because the free space is split into holes that are each too small: external fragmentation. Comparing the strategies on the same input shows the trade-off. Best fit leaves many tiny, unusable holes; worst fit keeps holes large but can use up the big ones early; first fit is fast and usually as good as best fit in practice.
Where this fits
Contiguous allocation is the first answer to giving processes memory; paging is the second, and once memory is full the page replacement calculator decides what to evict. Between the processor and RAM, the cache mapping calculator shows how addresses map onto cache lines.