In no particular order…
The upcoming macOS 26 release is the last new version for any Mac with an Intel processor, including your i5.
Either M2 or M4 will do fine for your reported usage.
I would suggest 16 GB memory, given you tend to keep your Mac for some years.
16 GB is standard in the latest Mac models, but some other Mac models will have 8 GB.
You will want to acquire more internal storage than you think you need over the lifetime of the Mac.
Neither memory nor internal storage can be upgraded after purchase.
I’d probably wait for replacement until macOS 26 starts shipping later this year, whether that replacement is with an existing M2 or M4 model, or maybe with something else that might be available then. But either an M2 or an M4 will be a large increase over that i5.
You’ll want to budget for a hard disk drive of roughly two or three times the internal storage capacity, for use for backups with Time Machine.