A liver biopsy is used to diagnose diseases of the liver such as hepatitis, cirrhosis, infections and cancer. It can also be used to examine a transplanted liver for signs of transplant rejection.
Liver biopsies are typically performed percutaneously by inserting a needle through the skin under ultrasound or CT guidance. The liver can also be biopsied via a catheter inserted through the jugular vein (a large neck vein). This is known as a trans jugular liver biopsy (TJLB). It is essential to have an expert liver pathologist interpret liver biopsies.
You can read more about a liver biopsy at the following sites.
https://patient.info/digestive-health/abnormal-liver-function-tests-leaflet/liver-biopsy
https://www.uptodate.com/contents/liver-biopsy-beyond-the-basics