Admittedly, I neither used the SD card as internal storage myself, but if I und erstand the concept correctly, there’s no easy way to reverse the setting. By taking out and reformatting the card, IMHO you risk to lose all data like after a factory reset.
So you I would recommend
- to really make sure all data (including apps & settings, if still needed) is backed up to another device (e.g. your PC),
- then do a factory reset and shut down the phone,
- reformat the SD card as external storage (in the phone or using a PC) and
- restore your data and settings on the phone.
That’s more or less what also @BertG recommended, I just wanted to make clear that changing the SD card setting quite probably might lead to loss of data if you miss something.
@BertG: no offense meant, only wanted to avoid potential misunderstanding and disappointment in case if issues.