What codec should I use to prepare video for After Effects so that After Effects freezes less?

Hello everyone.
I process videos of 3-10 seconds in After Effects. There are many codecs in Shortcut, some of which do not support high resolution. I understand that there are codecs that are easier for video editors to work with. I have 16 gigabytes of RAM and there is material in 2K and 4K resolution, what can I do with this?