In ("standard") OT, there is a given list of constraints – the problem is nobody knows what the exact set of constraints is. Typically, people intuit the phonetic motivation for a particular change, then write a constraint that does that. For Korean, there is a rampant nasalization pattern where any obstruent becomes nasal before another nasal. So there is a constraint that says you can't have an oral obstruent followed by a nasal – usually this is abbreviated as "*ON" or something like that. Every language has this, it's just ranked high in Korean and low in English. In English, "Ident-Nasal" which says "don't change the nasality of a segment" is ranked higher. Now what you have to do is figure out a system of constraints that say what is forbidden, and order the constraints so that you get the right output.
Your third example [hænmmeɪd] is empirically questionable (one m, not two); what else you have to say is what each of these comes from (hint: not spelling). Then you have to discover some constraint that says "you have to change the input". This is where phonetic intuitions play a role -- do you know the functional explanation for this? There are actually a lot of OT-type analyses, some which merely translate standard rule-type notions into "don't do this" thinking, and some which talk about timing of articulators and acoustic consequences of articulatory overlap. It depends on what degree of explanation you want to encode in your grammatical statements.
In line with my observation that you have to say what the constraints are, you ultimately have to say what all of the constraints are, and their ranking. For example, suppose you have a "Markedness" constraint *db which penalizes that specific phoneme sequence. Ident-IO demands that the input and output be the same, thus any change to /hænd bæg/ violates that constraint. If you only consider these two constraints and the two candidates [hænd bæg, hæm bæg], you will get the right output. But there are many more outputs to consider (infinitely many, possibly uncountably many). You need other constraints to rule out [hænt bæg, hændə bæg, hænd æg, hæn bæg, hæ bæg, hænd gæg]. Once you specify the additional constraints and rankings which rule out those outputs, I can provide you with an additional collection of outputs that you would need to avoid.
In addition, you've stumbled across a problem in the theory of constraints, that there will be a divide among practitioners as to whether "*db is a constraint in the theory. It lacks generality, and falsely predicts that /d/ deleted before [b] when preceded by an obstruent, /l/, /r/, or a vowel. But you don't say *[glæb bæg, glæ bæg] for "glad bag". Nevertheless, there is a sub-trend in OT to disassemble generalizations and re-state them as a series of phoneme-specific constraints. Since constraints are taken to be genetically innate, the objection that this misses a generalization doesn't always carry weight. Likewise, there has been controversy over what the faithfulness constraints are, for instance do they state a demand of identity for each individual feature, or are they stated in terms of each feature plus certain combinations (treating [coronal, anterior, high] together); and can they be context-sensitive ("identical for coronal if [+voice]")?