The Samsung Galaxy A31 is a mid-range Android device released by Samsung in April 2020. Identifiable by model numbers SM-A315(F, F/DS, G/DS, and G/DSL).
Have you tried cleaning the sim card with a soft cloth with isopropyl alcohol on it, and blowing out the slot with compressed air? Also make sure that the second sim card is inserted the right way, as if it is upside down or backwards, it won’t work.