The Google Nexus 4 is an old device now and while it isn’t getting officially updated to Marshmallow it has been invited to the Android 6 Marshmallow party thanks to developers of ROMs.
You can put one of two choices of Android 6 Marshmallow onto the Google Nexus 4 with one coming from Dmitry Grinberg and the other from Aldrin Holmes. One of the first things that you need to do before updating is to make a backup of the data on your handset.
When you have done that you will need to transfer the TWRP file to the device and update/install it. Turn off the device and switch it on to Recovery Mode ( Volume up + Volume Down + Power Button). Once the TWP UI loads up, choose Wipe > Factory Reset. Next Transfers one fo the ROM-GApps into the device and reboot to enter Recovery mode again.
When you have done this you can then find the ROM and install this and install GApps too. You should then reboot the Google Nexus 4 and you will have Android 6 Marshmallow on it.