when ever i press realms it says Realms (400) on aristois 1.18 and 1.18.1
You can only join realms with the latest supported version. In this case, only 1.18.1 will work.
I tested on my end to ensure it's working correctly. You cannot use any version besides 1.18.1 and you cannot log in to any alt accounts before attempting to join the realm.
Are you sure that 400 is the correct error message? This is usually used when referring to uploading a realm world, not attempting to join. If it still occurs on 1.18.1 please include a screenshot of the error screen.