Refer to build guides on
Logical Increments and
PCPartPicker.
MAXIMUS X Z370 and i7-8700K are top-performance parts. But a "lesser" Z370 motherboard and i5-/i7-8xxx CPU would cost less and might serve your needs well enough.
A TUF Z370 might be a good choice if you want to "guarantee" 5-year lifetime.
GTX 1080Ti is the right choice for 4K.
2x8GB DDR4 is the best choice. 2x16GB or 4x8GB might future-proof a little better over the course of 5 years, but on the other side of the coin it'll also cost much less later than it does now, if you need it.
System M.2 SSD doesn't really need to be large (60GB, 120GB, 240GB are quite workable) but bigger drives have space to install more apps/games. You can save money downsizing this component a little, if needed. Multi-TB HDDs are still the cheapest way to get maximum storage capacity for all the stuff which doesn't require fast performance. Don't buy SSHDs, don't buy Optane.
Don't skimp on PSU and cooling. Spending an extra 50€ on these can buy you a lot more stability and reliability and longevity, especially if you overclock. Higher efficiency ratings (Silver, Gold, Platinum, etc) are worth buying because they're a good general indicator of overall PSU quality. Manufacturer's warranty is also a good indicator of quality/longevity: 3 years is typical, 5 years is better, 7 years is best, and 10 years is unbeatable. PSUs are a highly competitive and saturated market, the products basically price themselves and you do get exactly what you pay for.
"All opinions are not equal. Some are a very great deal more robust, sophisticated and well supported in logic and argument than others." - Douglas Adams
[/Korth]