A myofibril is a basic rod-like unit of a muscle cell that is essential for muscle contraction. It is composed of repeating sections of sarcomeres, which contain the actin and myosin filaments responsible for the striated appearance of skeletal and cardiac muscles.