Trills and other similar ornaments are sometimes very difficult on the guitar.
There are many occasions in which the trill can be played on two strings, achieving something similar to what we hear on the harpsichord.
It is important to note that the cross-string trill may not always fit the style of the piece of music you are playing. I would suggest that in Baroque music they are a good choice, especially if the music has been transcribed from the harpsichord.
The basic technique is relatively simple and with a bit of practice, you will be trilling beautifully.
The right hand fingering I use is -a-i-m-p- for most trills . The trick is to get all the notes sounding the same in rhythm and the same volume.
Here are some examples and a couple of illustrations of my hands.