Think backwards
Literally: “ To me it is pleasing.” The thing liked is the grammatical subject — so the verb agrees with it , not with “I”.
Me gusta el café (singular subject → gusta). Me gustan los libros (plural subject → gustan).
This feels backwards from English but is completely normal in Spanish.