Hi HAnnahHUghE
welcome to the Apple (user-to-user) Community!
Re: "every time I try to sign into my Apple ID it takes me through the whole process
but then right before it works it takes my back to the sign in page."
Seems you have MacOS Monterey 12.7 installed on your Mac:
What's new in the updates for macOS Monterey - Apple Support says macOS Monterey 12.7.6 is the latest update
NB: This update provides important security fixes and is recommended for all users
(Also: If updating, it is wise to first back-up your data securely.)
Wondering which MacBook Air model you have: See how to: Identify your MacBook Air model - Apple Support
You may be able to upgrade to a newer compatible Mac operating system, (as listed under each item in article).
_______________________________________________________________
Re: "I can't sign into my Apple ID because it kicks me out of it last minute".
Wondering if you are signing in to your Apple ID on your Mac
or trying to log-in to your Apple ID account online ..... and if there is any error message ?
You may want to first check you are signed in (to your Mac). with your correct Apple ID:
See how to: Sign in with your Apple ID - Apple Support
( More info. if you want to: Change Sign-In & Security settings for your Apple ID on Mac - Apple Support )
___________________________________
Else: Try logging in to your online account to check all is in order, or update details: https://appleid.apple.com/
If needed:
See how to: Get a verification code and sign in with two-factor authentication - Apple Support
_________________
If you still need help: You might want to try re-starting your Mac: ie: Apple Menu > Restart. Then log back in to your Mac, and see if you can sign in to your Apple ID ok. (Restarting deletes temporary files, re-establishes connections, may update recent setting changes; often restores order if something is not working as expected)
________________________________________________________________________________________________
More trouble-shooting if needed:
What to do: If your Apple ID is locked, not active, or disabled - Apple Support
Apple ID support / help website (eg: you can contact support staff via online chat / phone / email etc):
Apple ID - Official Apple Support
All the best :-)