Some helpful websites to code the inertia tags:
https://en.wikipedia.org/wiki/List_of_moments_of_inertia#List_of_3D_inertia_tensors
By following this link and scrolling to the List of 3D inertia tensors, you will find moment of inertia tensor matrices for various shapes. These matrices can be used in the inertia tags when defining a robot's URDF model.
https://wiki.ros.org/urdf/Tutorials/Adding Physical and Collision Properties to a URDF Model#Inertia
Following this link and scrolling to the 2.1 Inertia paragraph, we get this important note:

This states that since the inertia matrix in symmetrical, it can be represented by only the 6 Bold elements.
Now we will add the Inertial Tag for the box that we have in our robot. We will add the Inertial Tag in the common_properties.xacro file using macro and then use it in the mobile_base.xacro file.
The following is the Inertia Tag:
<xacro:macro name="box_inertia" params="m w h d xyz rpy">
<inertial>
<origin xyz="${xyz}" rpy="${rpy}" />
<mass value="${m}" />
<inertia ixx="${(m/12) * (h*h + d*d)}" ixy="0" ixz="0"
iyy="${(m/12) * (w*w + d*d)}" iyz="0"
izz="${(m/12) * (w*w + h*h)}" />
</inertial>
</xacro:macro>
Note that the equations for the Inertia Tag can be found in the Wikipedia List of moments of inertia link above

In the mobile_base.xacro file we have add the Inertial Tag to the base_link and below is the code:
<link name="base_link">
<visual>
<geometry>
<box size="${base_length} ${base_width} ${base_height}" />
</geometry>
<origin xyz="0 0 ${base_height / 2.0}" rpy="0 0 0" />
<material name="blue" />
</visual>
<xacro:box_inertia m="5.0" w="${base_width}" h="${base_height}" d="${base_length}"
xyz="0 0 ${base_height / 2.0}" rpy="0 0 0" />
</link>