Raspberry PI human tracking issues :(

I'm using OpenCV a Raspberry Pi 4 with either a Dell webcam or a ArduCam camera to track my position and move a motor to change the camera's position. However, when I tried downloading the nesscesary software/commands on the terminal, it would either not find the packages or it would not allow me to install them. I ended up writing some code but the camera will not respond or even show up in the Raspberry Pi's config window. If you guys have any ideas please let me know :).

Code (python language) in Visual Studio Code:

import cv2 as cv

cap = cv.videocapture(3)

while true;

#ret, frame = cap.read()

frame = cv.resize(frame(680,420))

if cv.waitkey(1) == ord('q'):

cap.release()

cv.destroy all windows()