Hi! I think the best solution is buying an audio interface, back in the day I used this one, it´s not that expensive
https://www.gear4music.es/es/Grabacion-y-Ordenadores/Behringer-UCG102-Link-Interfaz-de-Audio-para-Guitarra/8CT?origin=product-ads&gclid=CjwKCAjw57b3BRBlEiwA1ImytllaIAsqwoQgWTrKxDkSLh8JPE40V_Yp6t30ZUtY4HAyy_6_BZh8wBoC6mkQAvD_BwE