If you really feel the need to use the 12 year old technology of an Arduino Uno/Nano/Mega linked to an ESP-01 as a WiFi modem (and incidentally the ESP-01is a faster, more powerful processor with more memory than either of these Arduinos) then you should read this…
In this day and age there are very few reasons why you shouldn’t throw the Arduino in the bin and use either a NodeMCU/Wemos D1 Mini or an ESP32 board rather than the Arduino-ESP-01 combination.
What is the use-case that requires you to use an Arduino + ESP-01 ?
Pete.