How to isolate the following circuit from mains or safely send a 5V signal from RPi to turn the relay on? I currently have a 5V signal going into the IN pin of the relay board and RPi ground to the GND pin of the relay board and it works. Is it safe even if I remove the 1.2V battery. I’m not very experienced with 220V AC.
The relay's coil and the switch already provide proper mains isolation. However you power the relay via a non isolated supply. It is a "capacitive dropper" circuit which is not isolated. Connect it to your RPi and your RPi will then become mains live.
If you want to keep the powering of the relay the same (i.e. non isolated) you will need to either use another relay (there are relay modules for RPi) or an optical isolation module. Then that module will provide the isolation. The circuit that you show does not provide any mains isolation. The reason that the relay is there is to switch a large current, not to provide any isolation.
I’m not very experienced with 220V AC. Then educate yourself on the subject before messing with circuits at mains voltage. Even seasoned professionals treat mains voltage with respect and so should you.
Other answers tell you why your current design is dangerous, this will answer how to do this safely.
You should get relay (board) that is capable of switching mains, but can be triggered with 3.3 V. This relay will then provide enough isolation between mains and your RPi.
PS, this kind of relay boards are popular and can be found on all of mayor distributors websites.