I see what problem you are facing with. The code the first element of the command list (command[0]) to determine what operation to perform.
if command[0] == 'insert':
my_list.insert(int(command[1]), int(command[2]))
elif command[0] == 'print':
print(my_list)
elif command[0] == 'remove':
my_list.remove(int(command[1]))
elif command[0] == 'append':
my_list.append(int(command[1]))
elif command[0] == 'sort':
my_list.sort()
elif command[0] == 'pop':
my_list.pop()
elif command[0] == 'reverse':
my_list.reverse()
- If command[0] is 'insert', it inserts an integer into my_list at the specified index.
- If command[0] is 'print', it prints the current contents of my_list.
- If command[0] is 'remove', it removes the first occurrence of a specified integer from my_list.
- If command[0] is 'append', it appends an integer to the end of my_list.
- If command[0] is 'sort', it sorts my_list in ascending order.
- If command[0] is 'pop', it removes and returns the last element of my_list.
- If command[0] is 'reverse', it reverses the order of elements in my_list.
Each command going to effect to list. For example if user enters 1 for N. Then enter insert 0 23 for command, it will insert the integer 23 at index 0 of my_list.

Final code:
if __name__ == '__main__':
N = int(input("How many command do you want to enter: "))
my_list = [1, 8, 9, 31, 25, 65] # we can add some elements
for _ in range(N):
command = input("Enter your commands: ").split() # Read the command as a space-separated string.
if command[0] == 'insert':
my_list.insert(int(command[1]), int(command[2]))
elif command[0] == 'print':
print(my_list)
elif command[0] == 'remove':
my_list.remove(int(command[1]))
elif command[0] == 'append':
my_list.append(int(command[1]))
elif command[0] == 'sort':
my_list.sort()
elif command[0] == 'pop':
my_list.pop()
elif command[0] == 'reverse':
my_list.reverse()
print(my_list)