One of the best things for good heatsinking is using thicker copper layers in the PCB.
Or you can use an aluminum PCB.
If you need you have it a one-sided PCB so you can thermally couple one side of the PCB to a metal heatsink.
Another thing that works well is paralleling mosfets. It can end up cheaper and have lower RDson (so less heat) when you put more fets in parallel. The ultra low Rds top-of-the-range mosfets tend to have a premium price. So if you can avoid them you save money you can spend on having more mosfets.
For example,
Your IRL40SC228 mosfet is 557A and 0.5mR and costs $4.62 in 1 off price.
TPH1R204PB,L1Q costs less, $1.55 but is 1.2mR and rated 150A.
If you used 3 in parallel it would cost $4.65 and be 0.4mR and work up to 450A or so
Having the heat generated in many separate locations really helps cooling a lot. Hot spots are the enemy.
It adds a little complexity in terms of PCB layout as you now have to check all fets will sharing the load equality. But that is usually not too much of a problem
On the other hand, if you don't care about heat because you will be adding a metal heatsink/fan to it then a single mosfet might be a simpler solution to get running quickly.
But keep in mind, adding extra mosfet of the same type in parallel makes a
huge difference over a single mosfet because you immediately have less heat to get rid of due to lower Rdson and on top of that the heat is not all in one spot.
If it's a one-off project and cost isn't much of a problem you could have 4 of those IRL40SC228 mosfet in parallel and then you only have to deal with 5W of heat instead of 20W and that's 5W over those 4 locations. so really its 4 locations that need to get rid of 1.25W
Probably don't even need a heatsink now, just a PCB with thick copper.