Aluminum matrix composites were created by adding silicon carbide (B4C) and silicon nitride (B4N) particles to AA6061 (AMCs). Using these AMCs requires the use of a suitable joining technique and the selection of relevant parameters. Friction stir welding (FSW) was used to appropriately fuse AA6061/B4C/5 wt%, AA6061/B4C/10 wt%, AA6061/B4C/15 wt% and AA6061/B4N/5 wt%, AA6061/B4N/10 wt%, and AA6061/B4N/15 wt% composite plates. An orthogonal array of Taguchi was used for experiments and parameter adjustment. For AA6061 B4C and AA6061/B4N composites, tool rotation speed, welding speed, and tool tilt angle all had an effect on the hardness of the weld zone. Stirring zone properties were improved by the homogeneous spreading of B4C particles and the spheroidization and spreading of silicon needles. It was discovered that the presence and pinning effect of hard B4N particles enhances the hardness of FSW joints. AA6061/B4C composite weld nuggets had a larger increase in micro hardness compared to AA6061/B4N composite weld nuggets, which had a smaller increase. In this study, the FSW parameters were optimized for successful welding and maximum hardness of AA6061/B4C and AA6061/B4N composites. The results of this study will be used to improve the FSW properties of components built from these composites and to make FSW joints as hard as possible.