Game slows down on certain moments

my game gets super slow and temporary freezes on some parts of the game: legendaries summoning screens(they are super slow, taking several minutes to load. i’ve seen in videos that they are supposed to shake, but for me it’s just moves from one side to the other and then freezes for a couple of seconds, it doesn’t crash but takes way more time than needed) and interactions with some pokemon species when they come to battle/faint no matter which side they are on and just general interactions like Mew, Fletchinder, Pumpkaboo and some other pokemons(it’s problem only with certain pokemons, others work completely fine!)
how to fix this?