The trigger pin or the hammer pin? They're identical but they are retained in different ways. The trigger pin stays in place because the hammer spring leg sits in a groove in the pin.
The hammer pin stays in place because of the j-spring in the hammer.
Check to see that your j-spring is still in the hammer and/or that your hammer spring leg is sitting in the groove in the trigger pin.
You can also buy anti-walk pins but 99% of ar15s don't NEED them