Hi there, thank you for getting in touch for support with your printer. On the front of the printer just above where the paper comes out when you print, there is a small flap that can be pulled forwards. It's found on the right-hand side. Pull that forwards and then you will see the little slots where the existing cartridges are. To release the existing cartridges first push them forwards until you hear a click and then pull them towards you and slide in the new cartridge once all the tabs have been removed from it. You can find diagrams on page 2 of this
HP OfficeJet 3831 guide on the HP website.
Let me know if you need any more help!