TL;DR: you don't, you enable RBF and adapt the transaction fee to the block space market (or use a wallet that does).
Best effort(s)
First of all, in order to be reliable the estimation must not be game-able by miners (or at least, most of the estimations must not be). Therefore it must not be mempool-based (such as the electrs
additional implementation, or by looking at Johoe's before making a transaction).
In this sense, the Bitcoin Core fee estimation (block chain based) is the most reliable.
Secondly, reliability is expensive. It can be measured by the statistical probability to get confirmed in less than N
blocks. And by this metric, the most reliable method is again Bitcoin Core's.
Finally, i think you are interested in the most optimal estimate: that is both reliable (you are going to be confirmed before your target, and for the cheapest possible fee).
But such an estimate does not exist: the block space is a free market and no matter the statistical reliability of your estimate, if someone wants to fill the blocks up to your target with megabytes of high-fee-paying transactions, they just can.
A guess isn't reliable
Since you cannot reliably estimate transaction fees, you need to adapt your price to the market. However you will only witness the market actions after broadcasting your transaction. This is the reason behind Replace-by-fee (you need a way to bump your fees post-broadcast).
But RBF is opt-in, you need to enable it before performing a transaction. In case you already broadcasted your transaction, you can fall back to CPFP (spend the unconfirmed output with a second, high fee paying, transaction that pays for both --example with Electrum).
Conclusion -- what should i use?
It depends on your usecase.
If you are an occasional onchain user, you can afford the game-able and less reliable mempool estimations (see for example https://bitcoinqueue.com/#0,24h or the friendlier https://mempool.observer/).
If you are building an application, prefer Bitcoin Core's block chain estimations as:
- For users reliability often outweighs cost (stuck transactions really aren't fun).
- With a larger sample of transactions, statistics are on your side.
- If all applications start relying on mempool estimations and fees continue to rise it becomes attracting for miners to collude :)
In both cases, when possible start with a lower estimation, enable RBF, and bump the fees as you are approaching your desired target without being confirmed.