During a liver biopsy, the doctor inserts a thin needle through the skin and into the liver to collect a small sample of tissue. This is usually done under local anesthesia, and the procedure may be guided by ultrasound or other imaging techniques to ensure accuracy.