We all know how dangerous electricity can be. That’s why people asking on how to install something in a junction box often get the advise to contact an electrician. That is indeed the most safe solution, but also a solution that costs money. If you have some technical knowledge and enough trust in DIY then you should pay a lot attention to information on how to work safely with electricity. You can get a deadly shock if you don’t pay enough attention on working safely with electricity. The website Happy DIY Home (a blog website about how to DIY things at your home) strives to help you out with their article about how to install/replace an electrical outlet: https://happydiyhome.com/how-to-install-electrical-outlet/
Above article is intended for citizens of the United States and any other country using the same sockets and electicity standards. We didn’t come across an article for other regions yet.
If you don’t have any experience and/or technical knowledge we keep on strongly advising to contact a technician!