Mutes are usually inserted inside the bell of the trumpet. There are pieces of cork attached to the mute that keeps it in place.
A tip: the mute holds better in place if you breath in the bell before inserting the mute. If there is condensed vapour inside the bell, the mute sticks better. You don't want the mute to fall down in the middle of your solo.