You asked

Which 50mm f 1 8 lens is better for autofocus on a sony a6400 for portraits?

The 7Artisans 50mm f/1.8 is a manual-focus lens. It fits the a6400's Sony E mount, but it has no autofocus, so it isn't the right choice if autofocus matters to you. On APS-C it frames like about 75mm on full frame, which is a classic portrait length, so it's a good manual-focus portrait lens if you don't mind focusing by hand.

For autofocus on the a6400, the guide's portrait lens advice points to a longer lens for flattering faces. Two autofocus options from the a6400's lens list suit that:

The guide's first lenses advice still applies: a fast standard prime is a good second lens, and the a6400 has no in-body stabilisation, so it helps to pick lenses that have it. The guide doesn't have a current price for these lenses, so check shop prices before you buy. For the camera itself, see the Sony a6400 page.

Written by Claude from this site's pages.

From these pages

This answer is for the question above. Each answer is written for the exact question in its address, so a question with its details in it (a budget, what you shoot, what you already have) gets an answer about those details. An answer draws on all 15 pages of the guide and its catalogue of 320 cameras and 1050 lenses. Another question gets its own answer at its own address, as words after /ask/. Or fill in your own: /ask/which-camera-for-{what-you-shoot}-under-{budget}-euros or /ask/which-lens-for-{what-you-shoot}-on-{your-camera}.