here's the basics of chords in the most simple way i can think of.
think of a regular c major scale.

this is the chord progression of the c major scale
basically, there are some chords that are gonna sound great in this scale, and some that aren't. you also have to take into account that some instruments have notes that are naturally sharp or flat, so you have to visualize the people who are going to play it (i.e. professional or hobbyists)
the V, the
dominant, is the second most important on the scale besides the tonic
to make a minor chord, you have to have the root note, a minor third, and a perfect 5th. this is called a
minor triadmost
major chords are just stacked on top of each other
a raised 7th chord (e.x. g7) chord is different for the major and minor. the major is simple, you just stack them up from the tonic to the 7th. i'm not exactly sure on the minor, so look that up yourself
fun fact: most songs end on the tonic chord of the scale
hope this helps
also don't let anyone tell you that composing music is ruleless. you
have to work on the same scale, or you're going to have a stuff ton of key changes if you just want any chord you want.