Inline predictive text (introduced in macOS Sonoma) shows a prediction for what you might type in grey ahead of where you are typing. Press space to accept the prediction. To turn this feature on or off, use these instructions...
Go to the Apple menu and choose "System Settings". Go to "Keyboard". Look for "Input Sources" and click the "Edit" button. Toggle the setting for "Show inline predictive text" on or off. Click "Done" and then exit System Settings.