If you're on Wayland, there should be a toggle for it in the KDE settings.
For me on Plasma 6, it's called "Middle Click:" and then "Pastes Selected Text", under "Workspace" → "General Behaviour".
If you're on X11, this is implemented in X.org, so X.org would need to provide that option, not KDE. I researched that for half a minute and it didn't look great, but yeah, you'll want to do your own research.
Or try out the Wayland session, if you haven't yet.