Will I lose my phone number or phone plan if I reset my Android to factory settings? I know I will lose my pictures, contacts, and stuff but those I can get back.
No. Factory reset erases data stored on
/data partition of your phone. It includes your preferences (what you set in Settings app), user apps and their settings/data, system apps' settings/data (including contacts and messages) and personal data stored on
/sdcard including pictures, videos and some apps' data (like WhatsApp stores media and messages backup on /sdcard).
But phone number is just an
id (MSISDN) mapped to International Mobile Subscriber Identity (IMSI) which is assigned by Mobile Network Operator (MNO) to your Universal Integrated Circuit Card (UICC; SIM/USIM) on GSM/UMTS/LTE networks or (CSIM/RUIM on) CDMA network, or to phone (identified by its ESN; Electronic Serial Number, compared to IMEI on GSM) on pre-3G CDMA network. This isn't something stored on your phone, it's your account's detail which is stored on your service provider's system.
eSIM is the UICC embedded inside phone (not considering iUICC or virtual/dummy SIM or pure software SIM) which is programmable so that you don't need to swap SIM cards. eSIM stores one or more profiles which hold essentially the same information as a physical SIM card - including ICCID, IMSI (MCC/MNC tuple + MSIN) etc. - which is linked to possibly multiple changeable MSISDNs (phone numbers we dial). And just like hardware SIM, eSIM is Secure Element, completely isolated from Android OS, even the processor. So it's not affected with any filesystem changes. If factory reset erases profiles intentionally, those can be re-programmed. All that's needed is the unique QR code which, if lost, can be obtained from MNO or even their apps can generate. So your phone number isn't affected.
Similarly your call/message/data plans are associated to your identity (phone number). You will be able to avail those services as long as you have a valid subscription and your SIM card is inserted in a compatible phone, identifiable and authentic-able by the MNO.
The quick answer is "No, it doesn't effect your plan or phone number".
Note: Factory reset is just a clean up process which includes permissions to clean and reset everything within device to it's factory made stage. Of course you have additional options to clean your SD card and sim contacts too, if you want.