Hi Indrani,
If it’s an option, recaptcha would be easier to implement, as there is marketplace content for it https://marketplace.mendix.com/link/component/115762
Otherwise, you’ll have to create a random captcha (use a DataSource, so with every refresh a new one is generated) and verify user input against it.